dlr-eoc / ukis-frontend-libraries

A collection of angular ui-components, services, interfaces... to help you create geospatial mapping applications for the web.
Apache License 2.0
17 stars 4 forks source link

Projection as part of mapState #204

Open voinSR opened 1 year ago

voinSR commented 1 year ago

Description

I propose to include current map projection into mapState object, next to the coordiantes, zoom and time.

Relevant Package

This feature request is for @dlr-eoc/....

Examples

Are there any examples in other projects that demonstrate this feature or enhancement? --> not yet

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds? --> no alternatives

if you guys give me a green light I would implement this feature and create PR

voinSR commented 1 year ago

in mapService i found projectionChange: Subject which can do the trick. But think it could make sense to bring this into mapState, isn't it?

boeckMt commented 1 year ago

Yes, that's a good idea.

So would it be enough to extend the MapState with epsg: string e.g.

export class MapState implements IMapState {
  zoom: number;
  center: {
    lat: number;
    lon: number;
  };
  options: IMapStateOptions;
  extent: TGeoExtent;
  time: string;
  epsg: string;
...

or do you need more parameters of a projection?

voinSR commented 1 year ago

i think we need to store somewhere a container with projection definitions for the map and to move the logic for projection switch to mapState (as we do with coordinates) and then projectionSwitch would not call mapSvc to change projection, but the mapState... ahh it is a bit bigger change than i thought

i have to think a bit

boeckMt commented 1 year ago

Here are some things to consider