Revision 58 org.gvsig.googlemaps/trunk/org.gvsig.googlemaps/org.gvsig.googlemaps.app/org.gvsig.googlemaps.app.mainplugin/src/main/java/org/gvsig/googlemaps/app/mainplugin/GoogleMapsService.java
GoogleMapsService.java | ||
---|---|---|
22 | 22 |
*/ |
23 | 23 |
package org.gvsig.googlemaps.app.mainplugin; |
24 | 24 |
|
25 |
import org.cresques.cts.IProjection; |
|
25 | 26 |
import org.slf4j.Logger; |
26 | 27 |
import org.slf4j.LoggerFactory; |
27 | 28 |
|
28 | 29 |
import org.gvsig.andami.PluginServices; |
29 | 30 |
import org.gvsig.andami.PluginsLocator; |
30 | 31 |
import org.gvsig.andami.PluginsManager; |
32 |
import org.gvsig.fmap.crs.CRSFactory; |
|
31 | 33 |
import org.gvsig.fmap.dal.DataStoreParameters; |
32 | 34 |
import org.gvsig.fmap.dal.exception.InitializeException; |
33 | 35 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
34 | 36 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
37 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
35 | 38 |
import org.gvsig.googlemaps.swing.api.GoogleMapsConfigDataParameters; |
36 | 39 |
import org.gvsig.googlemaps.swing.api.GoogleMapsParametersPanel; |
37 | 40 |
import org.gvsig.googlemaps.swing.api.GoogleMapsSwingLocator; |
... | ... | |
53 | 56 |
private static final String PANELNAME = "_google_maps"; |
54 | 57 |
private Logger log = LoggerFactory.getLogger(GoogleMapsService.class); |
55 | 58 |
private GoogleMapsParametersPanel parametersPanel; |
59 |
private MapControl mapCtrl; |
|
56 | 60 |
|
57 | 61 |
/** |
58 | 62 |
* Default constructor |
... | ... | |
72 | 76 |
if (parametersPanel==null){ |
73 | 77 |
GoogleMapsConfigDataParameters configParams= getGoogleMapsConfigDataParameters(); |
74 | 78 |
parametersPanel=GoogleMapsSwingLocator.getManager().createGoogleMapsParametersPanel(configParams); |
79 |
IProjection googleMapsProjection = CRSFactory.getCRS("EPSG:3857"); |
|
80 |
if(mapCtrl!=null && !(mapCtrl.getProjection().equals(googleMapsProjection))){ |
|
81 |
parametersPanel.showCrsWarning(true); |
|
82 |
} |
|
75 | 83 |
} |
76 | 84 |
return parametersPanel; |
77 | 85 |
} |
... | ... | |
109 | 117 |
return panelParams; |
110 | 118 |
} |
111 | 119 |
|
120 |
/* (non-Javadoc) |
|
121 |
* @see org.gvsig.webmap.lib.api.WebMapService#setMapCtrl(org.gvsig.fmap.mapcontrol.MapControl) |
|
122 |
*/ |
|
123 |
@Override |
|
124 |
public void setMapCtrl(MapControl mapControl) { |
|
125 |
this.mapCtrl = mapControl; |
|
126 |
IProjection googleMapsProjection = CRSFactory.getCRS("EPSG:3857"); |
|
127 |
if(mapCtrl!=null && !(mapCtrl.getProjection().equals(googleMapsProjection))){ |
|
128 |
((GoogleMapsParametersPanel)getParametersPanel()).showCrsWarning(true); |
|
129 |
} |
|
130 |
} |
|
131 |
|
|
112 | 132 |
} |
Also available in: Unified diff