|
@@ -133,10 +133,10 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
|
|
|
|
|
_layer = new OpenLayers.Layer.Vector(priv.options.layerName, {
|
|
_layer = new OpenLayers.Layer.Vector(priv.options.layerName, {
|
|
|
strategies: [new OpenLayers.Strategy.BBOX()],
|
|
strategies: [new OpenLayers.Strategy.BBOX()],
|
|
|
- projection: new OpenLayers.Projection("EPSG:900913"),
|
|
|
|
|
|
|
+ projection: new OpenLayers.Projection("EPSG:4326"),
|
|
|
protocol: new OpenLayers.Protocol.WFS({
|
|
protocol: new OpenLayers.Protocol.WFS({
|
|
|
version: "1.1.0",
|
|
version: "1.1.0",
|
|
|
- srsName: "EPSG:900913",
|
|
|
|
|
|
|
+ srsName: "EPSG:4326",
|
|
|
url: priv.options.wfsUrl,
|
|
url: priv.options.wfsUrl,
|
|
|
featureNS : "http://opengeo.org",
|
|
featureNS : "http://opengeo.org",
|
|
|
featureType: "restricted",
|
|
featureType: "restricted",
|
|
@@ -270,10 +270,6 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
})
|
|
})
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
- var extent = new OpenLayers.Bounds(
|
|
|
|
|
- 2035059.4410645328, 7200979.560689885, 2113330.958028555, 7279251.0776539035
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
var gphy = new OpenLayers.Layer.OSM("Mapa", null, {
|
|
var gphy = new OpenLayers.Layer.OSM("Mapa", null, {
|
|
|
resolutions: [156543.03390625, 78271.516953125, 39135.7584765625,
|
|
resolutions: [156543.03390625, 78271.516953125, 39135.7584765625,
|
|
|
19567.87923828125, 9783.939619140625, 4891.9698095703125,
|
|
19567.87923828125, 9783.939619140625, 4891.9698095703125,
|
|
@@ -294,10 +290,18 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
transitionEffect: 'resize'
|
|
transitionEffect: 'resize'
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ /* NOTE: map is in projection EPSG:900913 even if projection and displayProjection is set to EPSG:4326
|
|
|
|
|
+ * _map.getProjectionObject(); returns EPSG:900913
|
|
|
|
|
+ * restrictedExtent should be set in EPSG:900913
|
|
|
|
|
+ * zoomToExtent should use EPSG:900913 - need to transform from EPSG:4326 to EPSG:900913
|
|
|
|
|
+ */
|
|
|
_map = new OpenLayers.Map(_nodeMapId, {
|
|
_map = new OpenLayers.Map(_nodeMapId, {
|
|
|
- projection: new OpenLayers.Projection("EPSG:900913"),
|
|
|
|
|
|
|
+ projection: new OpenLayers.Projection("EPSG:4326"),
|
|
|
displayProjection: new OpenLayers.Projection("EPSG:4326"),
|
|
displayProjection: new OpenLayers.Projection("EPSG:4326"),
|
|
|
- restrictedExtent: extent,
|
|
|
|
|
|
|
+ restrictedExtent: new OpenLayers.Bounds(
|
|
|
|
|
+ 2035059.4410645328, 7200979.560689885, 2113330.958028555, 7279251.0776539035
|
|
|
|
|
+ //18.281250002544773, 54.16243397333987, 18.984375002642665, 54.57206166093501
|
|
|
|
|
+ ),
|
|
|
controls: [
|
|
controls: [
|
|
|
toolbar,
|
|
toolbar,
|
|
|
new OpenLayers.Control.ZoomPanel(),
|
|
new OpenLayers.Control.ZoomPanel(),
|
|
@@ -697,7 +701,9 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
|
|
|
|
|
publ.zoomToExtent = function(extent) {
|
|
publ.zoomToExtent = function(extent) {
|
|
|
if (!extent) return;
|
|
if (!extent) return;
|
|
|
- var extentBounds = OpenLayers.Geometry.fromWKT(extent).getBounds();
|
|
|
|
|
|
|
+ var sourceProj = new OpenLayers.Projection("EPSG:4326");
|
|
|
|
|
+ var targetProj = _map.getProjectionObject();
|
|
|
|
|
+ var extentBounds = OpenLayers.Geometry.fromWKT(extent).transform(sourceProj, targetProj).getBounds();
|
|
|
_map.zoomToExtent(extentBounds);
|
|
_map.zoomToExtent(extentBounds);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -851,7 +857,7 @@ class TableAjaxMapWfsAction {
|
|
|
</gml:Envelope>
|
|
</gml:Envelope>
|
|
|
</gml:boundedBy>
|
|
</gml:boundedBy>
|
|
|
<og:the_geom>
|
|
<og:the_geom>
|
|
|
- <gml:MultiSurface srsDimension="2" srsName="http://www.opengis.net/gml/srs/epsg.xml#900913">
|
|
|
|
|
|
|
+ <gml:MultiSurface srsDimension="2" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
|
|
|
<gml:surfaceMember>
|
|
<gml:surfaceMember>
|
|
|
<gml:Polygon srsDimension="2">
|
|
<gml:Polygon srsDimension="2">
|
|
|
<gml:exterior>
|
|
<gml:exterior>
|