|
|
@@ -33,6 +33,8 @@ class TableAjaxMap {
|
|
|
.TableAjaxMap { width:100%; height:<?php echo $this->_height; ?>px; }
|
|
|
.olControlEditingToolbar .olControlModifyFeatureItemInactive { background-image:url(stuff/open-layers/theme/default/img/draw_point_off.png); }
|
|
|
.olControlEditingToolbar .olControlModifyFeatureItemActive { background-image:url(stuff/open-layers/theme/default/img/draw_point_on.png); }
|
|
|
+.olControlEditingToolbar .olControlRefreshItemInactive { background-image: url(stuff/open-layers/theme/default/img/refresh_feature_off.png); }
|
|
|
+.olControlEditingToolbar .olControlRefreshItemActive { background-image: url(stuff/open-layers/theme/default/img/refresh_feature_on.png); }
|
|
|
.olControlLayerSwitcher .layersDiv { border-radius:10px 0 0 10px; opacity:0.75; filter:alpha(opacity=75); }
|
|
|
.notsupported { color:red; }
|
|
|
.TableAjaxMap .layersDiv input { margin:0; }
|
|
|
@@ -163,22 +165,59 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
title: "Select feature"
|
|
|
})]);
|
|
|
toolbar.addControls([
|
|
|
- new OpenLayers.Control.SelectFeature(
|
|
|
- _layer,
|
|
|
- {
|
|
|
- clickout: false, toggle: false,
|
|
|
- multiple: false, hover: false,
|
|
|
+ new OpenLayers.Control.SelectFeature(_layer, {
|
|
|
+ title: "Select Test",
|
|
|
+ clickout: false,
|
|
|
+ toggle: false,
|
|
|
+ multiple: false,
|
|
|
+ hover: false,
|
|
|
toggleKey: "ctrlKey", // ctrl key removes from selection
|
|
|
multipleKey: "shiftKey", // shift key adds to selection
|
|
|
box: true
|
|
|
})
|
|
|
]);
|
|
|
+ toolbar.addControls([
|
|
|
+ new OpenLayers.Control.Button({
|
|
|
+ title: "Zoom Test",
|
|
|
+ displayClass: "olControlZoomToPoly",
|
|
|
+ trigger: function() {
|
|
|
+ var multiPolygon = OpenLayers.Geometry.fromWKT("MULTIPOLYGON(((2072016.74395199 7234076.79293037,2072016.74395199 7234115.01144451,2072131.3994944 7234115.01144451,2072131.3994944 7234076.79293037,2072016.74395199 7234076.79293037)))").getBounds();
|
|
|
+ _map.zoomToExtent(multiPolygon);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ]);
|
|
|
+ var btnRefresh = new OpenLayers.Control.Button({
|
|
|
+ title: "Refresh",
|
|
|
+ displayClass: "olControlRefresh",
|
|
|
+ trigger: function() {
|
|
|
+ _layer.refresh({force: true});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ toolbar.addControls([btnRefresh]);
|
|
|
|
|
|
var extent = new OpenLayers.Bounds(
|
|
|
2035059.4410645328, 7200979.560689885, 2113330.958028555, 7279251.0776539035
|
|
|
);
|
|
|
|
|
|
- var gphy = new OpenLayers.Layer.OSM("Mapa");
|
|
|
+ var gphy = new OpenLayers.Layer.OSM("Mapa", null, {
|
|
|
+ resolutions: [156543.03390625, 78271.516953125, 39135.7584765625,
|
|
|
+ 19567.87923828125, 9783.939619140625, 4891.9698095703125,
|
|
|
+ 2445.9849047851562, 1222.9924523925781, 611.4962261962891,
|
|
|
+ 305.74811309814453, 152.87405654907226, 76.43702827453613,
|
|
|
+ 38.218514137268066, 19.109257068634033, 9.554628534317017,
|
|
|
+ 4.777314267158508, 2.388657133579254, 1.194328566789627,
|
|
|
+ 0.5971642833948135, 0.25, 0.1, 0.05],
|
|
|
+ serverResolutions: [156543.03390625, 78271.516953125, 39135.7584765625,
|
|
|
+ 19567.87923828125, 9783.939619140625,
|
|
|
+ 4891.9698095703125, 2445.9849047851562,
|
|
|
+ 1222.9924523925781, 611.4962261962891,
|
|
|
+ 305.74811309814453, 152.87405654907226,
|
|
|
+ 76.43702827453613, 38.218514137268066,
|
|
|
+ 19.109257068634033, 9.554628534317017,
|
|
|
+ 4.777314267158508, 2.388657133579254,
|
|
|
+ 1.194328566789627, 0.5971642833948135],
|
|
|
+ transitionEffect: 'resize'
|
|
|
+ });
|
|
|
|
|
|
_map = new OpenLayers.Map(_nodeMapId, {
|
|
|
projection: new OpenLayers.Projection("EPSG:900913"),
|
|
|
@@ -502,6 +541,11 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
_map.updateSize();
|
|
|
};
|
|
|
|
|
|
+ publ.zoomToExtent = function(extent) {
|
|
|
+ var extentBounds = OpenLayers.Geometry.fromWKT(extent).getBounds();
|
|
|
+ _map.zoomToExtent(extentBounds);
|
|
|
+ };
|
|
|
+
|
|
|
publ.init = function(options) {
|
|
|
if (priv.options.debug) console.log('TableAjaxMap initialization...', options);
|
|
|
//merge supplied options with defaults
|
|
|
@@ -515,15 +559,25 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
|
|
|
$.fn.TableAjaxMapUpdateSize = function(options) {
|
|
|
options = options || {};
|
|
|
return this.each(function() {
|
|
|
- options.id = this;
|
|
|
- if ($(this).data('TableAjaxMap')) {
|
|
|
- var tblAjaxMap = $(this).data('TableAjaxMap');
|
|
|
+ var tblAjaxMap = $(this).data('TableAjaxMap');
|
|
|
+ if (tblAjaxMap) {
|
|
|
tblAjaxMap.updateSize();
|
|
|
}
|
|
|
});
|
|
|
return this;
|
|
|
};
|
|
|
|
|
|
+ $.fn.TableAjaxMapZoomToExtent = function(extent) {
|
|
|
+ if (!extent) return;
|
|
|
+ return this.each(function() {
|
|
|
+ var tblAjaxMap = $(this).data('TableAjaxMap');
|
|
|
+ if (tblAjaxMap) {
|
|
|
+ tblAjaxMap.zoomToExtent(extent);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return this;
|
|
|
+ };
|
|
|
+
|
|
|
$.fn.TableAjaxMap = function(options) {
|
|
|
options = options || {};
|
|
|
return this.each(function() {
|