Revision 58 org.gvsig.bingmaps/trunk/org.gvsig.bingmaps/org.gvsig.bingmaps.app/org.gvsig.bingmaps.app.mainplugin/src/main/java/org/gvsig/bingmaps/app/mainplugin/BingMapsService.java
BingMapsService.java | ||
---|---|---|
29 | 29 |
import java.util.Properties; |
30 | 30 |
|
31 | 31 |
import org.apache.commons.io.IOUtils; |
32 |
import org.cresques.cts.IProjection; |
|
33 |
|
|
32 | 34 |
import org.gvsig.andami.PluginServices; |
33 | 35 |
import org.gvsig.andami.PluginsLocator; |
34 | 36 |
import org.gvsig.andami.PluginsManager; |
... | ... | |
36 | 38 |
import org.gvsig.bingmaps.swing.api.BingMapsParametersPanel; |
37 | 39 |
import org.gvsig.bingmaps.swing.api.BingMapsSwingLocator; |
38 | 40 |
import org.gvsig.bingmaps.swing.api.BingMapsSwingManager; |
41 |
import org.gvsig.fmap.crs.CRSFactory; |
|
39 | 42 |
import org.gvsig.fmap.dal.DataStoreParameters; |
40 | 43 |
import org.gvsig.fmap.dal.exception.InitializeException; |
41 | 44 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
42 | 45 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
46 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
43 | 47 |
import org.gvsig.tools.ToolsLocator; |
44 | 48 |
import org.gvsig.tools.dynobject.DynObject; |
45 | 49 |
import org.gvsig.tools.i18n.I18nManager; |
46 | 50 |
import org.gvsig.tools.swing.api.Component; |
47 | 51 |
import org.gvsig.webmap.lib.api.WebMapService; |
48 | 52 |
import org.gvsig.webmap.lib.api.exceptions.WebMapInvalidParamsException; |
53 |
|
|
49 | 54 |
import org.slf4j.Logger; |
50 | 55 |
import org.slf4j.LoggerFactory; |
51 | 56 |
|
... | ... | |
60 | 65 |
private static final String defaultPropertiesFilename = "defaultConfig.properties"; |
61 | 66 |
private Logger log = LoggerFactory.getLogger(BingMapsService.class); |
62 | 67 |
private BingMapsParametersPanel parametersPanel; |
68 |
private MapControl mapCtrl; |
|
63 | 69 |
|
64 | 70 |
/** |
65 | 71 |
* Default Constructor |
... | ... | |
79 | 85 |
if (parametersPanel==null){ |
80 | 86 |
BingMapsConfigDataParameters configParams= getBingMapsConfigDataParameters(); |
81 | 87 |
parametersPanel=BingMapsSwingLocator.getManager().createBingMapsParametersPanel(configParams); |
88 |
IProjection bingMapsProjection = CRSFactory.getCRS("EPSG:3857"); |
|
89 |
if(mapCtrl!=null && !(mapCtrl.getProjection().equals(bingMapsProjection))){ |
|
90 |
parametersPanel.showCrsWarning(true); |
|
91 |
} |
|
92 |
|
|
82 | 93 |
} |
83 | 94 |
return parametersPanel; |
84 | 95 |
} |
... | ... | |
117 | 128 |
return panelParams; |
118 | 129 |
} |
119 | 130 |
|
131 |
/* (non-Javadoc) |
|
132 |
* @see org.gvsig.webmap.lib.api.WebMapService#setMapCtrl(org.gvsig.fmap.mapcontrol.MapControl) |
|
133 |
*/ |
|
134 |
@Override |
|
135 |
public void setMapCtrl(MapControl mapControl) { |
|
136 |
this.mapCtrl = mapControl; |
|
137 |
IProjection googleMapsProjection = CRSFactory.getCRS("EPSG:3857"); |
|
138 |
if(mapCtrl!=null && !(mapCtrl.getProjection().equals(googleMapsProjection))){ |
|
139 |
((BingMapsParametersPanel)getParametersPanel()).showCrsWarning(true); |
|
140 |
} |
|
141 |
} |
|
120 | 142 |
|
121 | 143 |
|
144 |
|
|
122 | 145 |
} |
Also available in: Unified diff