Skip to content

Search for Map CRS coordinates #10136

@tdipisa

Description

@tdipisa

Description

It is requested with this issue to improve the CoordinatesSearch tool to be able to use coordinates expressed in the selected Map CRS, now it is possible a search for coordinates in the defined on the map, now it's only possible by Lat/Long.

Image

A proper entry in the current coordinate type selector (decimal/aeronautical) should allow to select the current Map CRS to setup the tool accordingly (e.g. use current Map CRS)

Image

Thank into account that the map CRS can vary according to the CRS selected din the CRS Selector.

What kind of improvement you want to add? (check one with "x", remove the others)

  • Minor changes to existing features
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Design

It would be good to implement the following UI/UX:

image

  • Selecting "Current map CRS" the possibility to switch between decimal/aeronautical disappear from the UI and the tool setup change by switching to map CRS coordinates

image

  • The "Current map CRS" is available only if the the current Map CRS is not the one normally used by decimal and aeronautical coordinates, which means EPSG:4326

image

  • As coordinate fields validator when "Current map CRS" is selected, the current one should be preserved which means:

    • The entered value is a number
    • The entered coordinates are within the CRS bounds
    • Same decimal separators should be used according locale as is also for other plugins where geographic coordinates are exposed
  • Current functionalities have to be maintained also when "Current map CRS" is selected e.g. when search is performed, the tool has to add the marker to the map and center / zoom the point as usual

Other useful information

The functionality is actually implemented here:

https://github.com/geosolutions-it/MapStore2/blob/master/web/client/components/mapcontrols/searchcoordinates/CoordinatesSearch.js

zoomAndAddPoint already send the CRS. This action is actually intercepted by epics/search.js --> zoomAndAddPointEpic

export const zoomAndAddPointEpic = (action$, store) =>
action$.ofType(ZOOM_ADD_POINT)
.switchMap(action => {
const feature = {
type: "Feature",
geometry: {
type: "Point",
coordinates: [action.pos.x, action.pos.y]
}
};
const state = store.getState();
return Rx.Observable.from([
updateAdditionalLayer("search", "search", 'overlay', {
features: [feature],
type: "vector",
name: "searchPoints",
id: "searchPoints",
visibility: true,
style: state.search && state.search.style || defaultIconStyle
}),
zoomToPoint(action.pos, action.zoom, action.crs)
]);
});

The epic does 2 operation.

  • Add a layer with the marker. This is in 4326, and should support also the map CRS (or be converted).
    zoomToPoint should already support a different CRS

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions