[josm-dev] WMSPlugin Update

Dirk Stöcker openstreetmap at dstoecker.de
Wed Sep 1 16:34:28 BST 2010


On Wed, 1 Sep 2010, Ian Dees wrote:

> My update does check the available CRS from GetCapabilities for each layer
> and will flag a layer as unusable if it doesn't match the current projection
> set in JOSM's preferences.
>
> I like your idea better, though: prompt the user to change the projection so
> that it matches the projection of the selected layer(s). Right now it would
> only support switching to 4326 I suppose, but in the future it could switch
> to other JOSM-supported projections. Is there a preferred method to call to
> set projection (so that the GUI is updated after the change)?

Just have a look in the preferences. It already calls the correct function 
somewhere in main or MapView. Maybe a trySetProjection(String code, bool ask) 
method would better be placed in core (getting projection and asking user 
to switch when requested). Patches welcome.

Getting projections is mainly asking all projections if they know the code 
(getPreferencesFromCode() or toCode() for these who don't have prefs).

Also WMS layers already get informed about projection changes. Currently 
they ignore it. Here some action would be required:
- ask and remove layer if projection can't be used
- switch to projection for layer when possible.

Ciao
-- 
http://www.dstoecker.eu/ (PGP key available)




More information about the josm-dev mailing list