cmv-widgets icon indicating copy to clipboard operation
cmv-widgets copied to clipboard

Projected Coordinates in URL

Open carey136 opened this issue 10 years ago • 5 comments
trafficstars

Hi @BrianBunker. The widget you've coded is exactly the solution i've been looking for, but I'm encountering a problem with projection.

My basemaps and layers all use the EPSG: 27700 (British National Grid). When I attempt to use the widget, the URL contains a static, meaningless co-ordinate and tile scale reference (#/4.1782/4.6218/2).

The browser error received for the mis-display is "Map: Geometry (wkid: 4326) cannot be converted to spatial reference of the map (wkid: 27700)".

Would I be correct in assuming that the widget does not support projected coordinate systems? And if this is the case, would it be of interest to include this functionality in the near future?

carey136 avatar Nov 20 '14 15:11 carey136

You are correct that the widget does not currently support projected coordinate systems. It would be of interest to include this functionality, but I do not have the time to undertake this addition currently. Pull requests are welcome.

BrianBunker avatar Nov 20 '14 20:11 BrianBunker

No worries. Sadly, after a few hours of flapping,I realise it is above me to add the desired code. I may have to ask for assistance on this one.

@btfou, @tmcgee, @tr3vorm - I've been trying to borrow code from the MapInfo widget to feed into the URL of this widget but i'm running into to trouble (namely, I have no idea what i'm doing). would you be able to offer any advice/assistance. This widget offers a great opportunity for other programs/applications to generate simple URL's for the viewer which can be shared or opened on command; as well as improved navigation with the back and forward buttons. It would be great to be able to use with projected coordinate systems.

Thanks

carey136 avatar Nov 21 '14 12:11 carey136

Notes for implementation:

  • Check the basemap service wkid on load
  • Use http://proj4js.org/ (+1 network call to retrieve library) to project points using projection definitions at http://spatialreference.org/ref/epsg// (+1 network call to retrieve definition)
  • Treat 102100 (3857) differently since it's not easily referenced from spatialreference.org -- trivial since this is current default for the widget

BrianBunker avatar May 11 '16 06:05 BrianBunker

For reference, I now use https://epsg.io/ to retrieve projection definitions instead of http://spatialreference.org/ because the latter is not available via SSL/HTTPS.

Soon I plan to convert the existing CMV core widgets (StreetView and MapInfo) to use https://epsg.io/. The HTTPS url will work regardless of whether the app is served from HTTP or HTTPS domain.

tmcgee avatar Jun 06 '16 23:06 tmcgee

Thanks for the reference!

BrianBunker avatar Jun 07 '16 02:06 BrianBunker