157 |
157 |
* @param proj Proyecci?n.
|
158 |
158 |
*/
|
159 |
159 |
public void setProjection(IProjection proj) {
|
160 |
|
projection = proj;
|
|
160 |
projection = proj;
|
161 |
161 |
// Comprobar que la proyecci?n es la misma que la de FMap
|
162 |
|
// Si no lo es, es una capa que est? reproyectada al vuelo
|
|
162 |
// Si no lo es, es una capa que est? reproyectada al vuelo
|
163 |
163 |
if ((proj != null) && (getFMap() != null))
|
164 |
164 |
if (proj != getFMap().getProjection())
|
165 |
165 |
{
|
166 |
166 |
ICoordTrans ct = new CoordTrans((CoordSys) proj,
|
167 |
167 |
(CoordSys) getFMap().getProjection());
|
168 |
168 |
setCoordTrans(ct);
|
169 |
|
logger.debug("Cambio proyecci?n: FMap con " + getFMap().getProjection().getAbrev()
|
|
169 |
logger.debug("Cambio proyecci?n: FMap con " + getFMap().getProjection().getAbrev()
|
170 |
170 |
+ " y capa " + getName() + " con " + proj.getAbrev());
|
171 |
|
}
|
|
171 |
}
|
172 |
172 |
}
|
173 |
173 |
|
174 |
174 |
/**
|
... | ... | |
219 |
219 |
xml.putProperty("name", name);
|
220 |
220 |
xml.putProperty("minScale",minScale);
|
221 |
221 |
xml.putProperty("maxScale",maxScale);
|
222 |
|
|
|
222 |
|
223 |
223 |
//TODO xml.addChild(parentLayer.getXMLEntity());
|
224 |
224 |
xml.putProperty("visible", visible);
|
225 |
225 |
if (projection != null) {
|
... | ... | |
244 |
244 |
active = xml.getBooleanProperty("active");
|
245 |
245 |
name = xml.getStringProperty("name");
|
246 |
246 |
minScale=xml.getDoubleProperty("minScale");
|
247 |
|
maxScale=xml.getDoubleProperty("maxScale");
|
|
247 |
maxScale=xml.getDoubleProperty("maxScale");
|
248 |
248 |
visible = xml.getBooleanProperty("visible");
|
249 |
249 |
if (xml.contains("proj")) {
|
250 |
250 |
setProjection(ProjectionPool.get(xml.getStringProperty("proj")));
|
... | ... | |
267 |
267 |
active = xml.getBooleanProperty("active");
|
268 |
268 |
name = xml.getStringProperty("name");
|
269 |
269 |
minScale=xml.getDoubleProperty("minScale");
|
270 |
|
maxScale=xml.getDoubleProperty("maxScale");
|
|
270 |
maxScale=xml.getDoubleProperty("maxScale");
|
271 |
271 |
visible = xml.getBooleanProperty("visible");
|
272 |
272 |
if (xml.contains("proj")) {
|
273 |
273 |
setProjection(ProjectionPool.get(xml.getStringProperty("proj")));
|
... | ... | |
290 |
290 |
active = xml.getBooleanProperty("active");
|
291 |
291 |
name = xml.getStringProperty("name");
|
292 |
292 |
minScale=xml.getDoubleProperty("minScale");
|
293 |
|
maxScale=xml.getDoubleProperty("maxScale");
|
|
293 |
maxScale=xml.getDoubleProperty("maxScale");
|
294 |
294 |
visible = xml.getBooleanProperty("visible");
|
295 |
295 |
if (xml.contains("proj")) {
|
296 |
296 |
setProjection(ProjectionPool.get(xml.getStringProperty("proj")));
|
... | ... | |
318 |
318 |
* @return boolean.
|
319 |
319 |
*/
|
320 |
320 |
public boolean addLayerListener(LayerListener o) {
|
|
321 |
if (layerListeners.contains(o))
|
|
322 |
return false;
|
321 |
323 |
return layerListeners.add(o);
|
322 |
324 |
}
|
323 |
325 |
|
... | ... | |
424 |
426 |
public ICoordTrans getCoordTrans() {
|
425 |
427 |
return ct;
|
426 |
428 |
}
|
427 |
|
|
|
429 |
|
428 |
430 |
public double getMinScale() {
|
429 |
431 |
return minScale;
|
430 |
432 |
}
|
... | ... | |
435 |
437 |
public double getMaxScale() {
|
436 |
438 |
return maxScale;
|
437 |
439 |
}
|
438 |
|
|
|
440 |
|
439 |
441 |
public void setMinScale(double minScale)
|
440 |
442 |
{
|
441 |
443 |
this.minScale = minScale;
|
... | ... | |
444 |
446 |
{
|
445 |
447 |
this.maxScale = maxScale;
|
446 |
448 |
}
|
447 |
|
|
|
449 |
|
448 |
450 |
public boolean isWithinScale(double scale)
|
449 |
451 |
{
|
450 |
|
|
|
452 |
|
451 |
453 |
boolean bVisible = true;
|
452 |
454 |
if (getMinScale() != -1)
|
453 |
455 |
{
|
... | ... | |
459 |
461 |
if (scale > getMaxScale())
|
460 |
462 |
bVisible = false;
|
461 |
463 |
}
|
462 |
|
|
|
464 |
|
463 |
465 |
return bVisible;
|
464 |
466 |
}
|
465 |
|
|
|
467 |
|
466 |
468 |
public Strategy getStrategy()
|
467 |
469 |
{
|
468 |
470 |
return privateStrategy;
|
469 |
471 |
}
|
470 |
|
public void setStrategy(Strategy s)
|
|
472 |
public void setStrategy(Strategy s)
|
471 |
473 |
{
|
472 |
474 |
privateStrategy = s;
|
473 |
475 |
}
|
... | ... | |
486 |
488 |
public boolean isEditing(){
|
487 |
489 |
return isediting;
|
488 |
490 |
}
|
489 |
|
|
490 |
|
|
|
491 |
|
|
492 |
|
491 |
493 |
}
|