|
@@ -45,10 +45,16 @@ class TableAjaxMap {
|
|
|
.notsupported { color:red; }
|
|
.notsupported { color:red; }
|
|
|
.TableAjaxMap .layersDiv input { margin:0; }
|
|
.TableAjaxMap .layersDiv input { margin:0; }
|
|
|
.TableAjaxMap .layersDiv label { display:inline; }
|
|
.TableAjaxMap .layersDiv label { display:inline; }
|
|
|
|
|
+
|
|
|
.olControlSelectedRecord { background: rgba(255, 255, 255, 0.6); padding:1px 0 0 3px; position:absolute; bottom:0; right:0; }
|
|
.olControlSelectedRecord { background: rgba(255, 255, 255, 0.6); padding:1px 0 0 3px; position:absolute; bottom:0; right:0; }
|
|
|
.olControlSelectedRecordClear { cursor:pointer; color:#bbb; }
|
|
.olControlSelectedRecordClear { cursor:pointer; color:#bbb; }
|
|
|
.olControlSelectedRecordClear:hover { color:#f00; }
|
|
.olControlSelectedRecordClear:hover { color:#f00; }
|
|
|
.olControlSelectedRecordMsg { color:#000; }
|
|
.olControlSelectedRecordMsg { color:#000; }
|
|
|
|
|
+
|
|
|
|
|
+.olControlManageLayers { background: rgba(255, 255, 255, 0.6); padding:1px 0 0 3px; position:absolute; bottom:20px; right:0; }
|
|
|
|
|
+.olControlManageLayersBtn { cursor:pointer; color:#bbb; }
|
|
|
|
|
+.olControlManageLayersBtn:hover { color:#f00; }
|
|
|
|
|
+.olControlManageLayersMsg { color:#000; }
|
|
|
</style>
|
|
</style>
|
|
|
<?php
|
|
<?php
|
|
|
}
|
|
}
|
|
@@ -63,6 +69,7 @@ var myOpenLayers_Control_SelectedRecord = OpenLayers.Class(OpenLayers.Control, {
|
|
|
|
|
|
|
|
selectedRecordId: 0,
|
|
selectedRecordId: 0,
|
|
|
msgNode: null,
|
|
msgNode: null,
|
|
|
|
|
+ clearNode: null,
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Method: draw
|
|
* Method: draw
|
|
@@ -131,6 +138,90 @@ var myOpenLayers_Control_SelectedRecord = OpenLayers.Class(OpenLayers.Control, {
|
|
|
CLASS_NAME: "OpenLayers.Control.SelectedRecord"
|
|
CLASS_NAME: "OpenLayers.Control.SelectedRecord"
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+var myOpenLayers_Control_ManageLayers = OpenLayers.Class(OpenLayers.Control, {
|
|
|
|
|
+
|
|
|
|
|
+ mapWidget: null,
|
|
|
|
|
+ msgNode: null,
|
|
|
|
|
+ testBtn: null,
|
|
|
|
|
+ layers: [],
|
|
|
|
|
+
|
|
|
|
|
+ draw: function() {
|
|
|
|
|
+ OpenLayers.Control.prototype.draw.apply(this, arguments);
|
|
|
|
|
+ if (!this.msgNode) {
|
|
|
|
|
+ this.msgNode = document.createElement("span");
|
|
|
|
|
+ this.msgNode.className = this.displayClass + "Msg";
|
|
|
|
|
+ this.div.appendChild(this.msgNode);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!this.testBtn) {
|
|
|
|
|
+ this.testBtn = document.createElement("span");
|
|
|
|
|
+ this.testBtn.title = "Dodaj warstwę - test babidol";
|
|
|
|
|
+ this.testBtn.className = this.displayClass + "Btn";
|
|
|
|
|
+ this.testBtn.className += ' glyphicon glyphicon-plus';
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ jQuery(this.testBtn).on('click', function(e) {
|
|
|
|
|
+ e.stopPropagation();
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+ that.testAddLayerBabidol();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.div.appendChild(this.testBtn);
|
|
|
|
|
+ }
|
|
|
|
|
+ this.updateView();
|
|
|
|
|
+ return this.div;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ setMapWidget: function(mapWidget) {
|
|
|
|
|
+ this.mapWidget = mapWidget;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ testAddLayerBabidol: function() {
|
|
|
|
|
+ if (this.layers.length > 0) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ var layerName = 'Babidol';
|
|
|
|
|
+ var wfsUrl = 'http://biuro.biall-net.pl/wps';
|
|
|
|
|
+ wfsUrl += '/21176/BABIDOL_DXF_SHP';// TODO: user choise by perms/item links
|
|
|
|
|
+ var _styleMap = new OpenLayers.StyleMap({
|
|
|
|
|
+ 'default': new OpenLayers.Style(null, {
|
|
|
|
|
+ rules: [
|
|
|
|
|
+ new OpenLayers.Rule({
|
|
|
|
|
+ symbolizer: {
|
|
|
|
|
+ stroke: true,
|
|
|
|
|
+ strokeWidth: 1,
|
|
|
|
|
+ fill: true,
|
|
|
|
|
+ fillColor: "#00a5ee",
|
|
|
|
|
+ strokeColor: "#00a5ee",
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ ]
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+ var testLayerBabidol = new OpenLayers.Layer.Vector(layerName, {
|
|
|
|
|
+ strategies: [new OpenLayers.Strategy.BBOX(), new OpenLayers.Strategy.Cluster({distance:30, threshold:3})],
|
|
|
|
|
+ projection: new OpenLayers.Projection("EPSG:4326"),
|
|
|
|
|
+ protocol: new OpenLayers.Protocol.WFS({
|
|
|
|
|
+ version: "1.1.0",
|
|
|
|
|
+ srsName: "EPSG:4326",
|
|
|
|
|
+ url: wfsUrl,
|
|
|
|
|
+ featureNS : "http://opengeo.org",
|
|
|
|
|
+ featureType: "restricted",
|
|
|
|
|
+ geometryName: "the_geom",
|
|
|
|
|
+ schema: "http://demo.opengeo.org/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=og:restricted"
|
|
|
|
|
+ }),
|
|
|
|
|
+ styleMap: _styleMap
|
|
|
|
|
+ });
|
|
|
|
|
+ this.layers.push(testLayerBabidol);
|
|
|
|
|
+ this.map.addLayers(this.layers);
|
|
|
|
|
+ this.updateView();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ updateView: function() {
|
|
|
|
|
+ this.msgNode.innerHTML = 'Warstwy ' + this.layers.length + ' ';
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ CLASS_NAME: "OpenLayers.Control.ManageLayers"
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
|
|
|
(function( $ ) {
|
|
(function( $ ) {
|
|
|
var TableAjaxMap = function() {
|
|
var TableAjaxMap = function() {
|
|
@@ -146,6 +237,7 @@ var myOpenLayers_Control_SelectedRecord = OpenLayers.Class(OpenLayers.Control, {
|
|
|
onSaveFeature: null,
|
|
onSaveFeature: null,
|
|
|
onSelectBox: null,
|
|
onSelectBox: null,
|
|
|
addBtn: null,
|
|
addBtn: null,
|
|
|
|
|
+ showAddLayerWidget: false,
|
|
|
debug: false
|
|
debug: false
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -507,7 +599,6 @@ var myOpenLayers_Control_SelectedRecord = OpenLayers.Class(OpenLayers.Control, {
|
|
|
]);
|
|
]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- _controlSelectedRecord = new myOpenLayers_Control_SelectedRecord();
|
|
|
|
|
|
|
|
|
|
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,
|
|
@@ -528,7 +619,21 @@ var myOpenLayers_Control_SelectedRecord = OpenLayers.Class(OpenLayers.Control, {
|
|
|
1.194328566789627, 0.5971642833948135],
|
|
1.194328566789627, 0.5971642833948135],
|
|
|
transitionEffect: 'resize'
|
|
transitionEffect: 'resize'
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+ var mapControls = [];
|
|
|
|
|
+ mapControls.push(toolbar);
|
|
|
|
|
+ mapControls.push(new OpenLayers.Control.ZoomPanel());
|
|
|
|
|
+ mapControls.push(new OpenLayers.Control.PanPanel());
|
|
|
|
|
+ mapControls.push(new OpenLayers.Control.LayerSwitcher());
|
|
|
|
|
+ mapControls.push(new OpenLayers.Control.ScaleLine());
|
|
|
|
|
+ _controlSelectedRecord = new myOpenLayers_Control_SelectedRecord();
|
|
|
|
|
+ mapControls.push(_controlSelectedRecord);
|
|
|
|
|
+ if (priv.options.showAddLayerWidget) {
|
|
|
|
|
+ _controlManageLayers = new myOpenLayers_Control_ManageLayers();
|
|
|
|
|
+ _controlManageLayers.setMapWidget(priv);
|
|
|
|
|
+ mapControls.push(_controlManageLayers);
|
|
|
|
|
+ }
|
|
|
|
|
+ // TODO: add box with selected record from table, x for remove selection
|
|
|
|
|
+ mapControls.push(new OpenLayers.Control.KeyboardDefaults());
|
|
|
/* NOTE: map is in projection EPSG:900913 even if projection and displayProjection is set to EPSG:4326
|
|
/* NOTE: map is in projection EPSG:900913 even if projection and displayProjection is set to EPSG:4326
|
|
|
* _map.getProjectionObject(); returns EPSG:900913
|
|
* _map.getProjectionObject(); returns EPSG:900913
|
|
|
* restrictedExtent should be set in EPSG:900913
|
|
* restrictedExtent should be set in EPSG:900913
|
|
@@ -540,16 +645,7 @@ var myOpenLayers_Control_SelectedRecord = OpenLayers.Class(OpenLayers.Control, {
|
|
|
restrictedExtent: new OpenLayers.Bounds(
|
|
restrictedExtent: new OpenLayers.Bounds(
|
|
|
1526390.4410645328, 6273526.00, 2693330.958028555, 7352240.00
|
|
1526390.4410645328, 6273526.00, 2693330.958028555, 7352240.00
|
|
|
),
|
|
),
|
|
|
- controls: [
|
|
|
|
|
- toolbar,
|
|
|
|
|
- new OpenLayers.Control.ZoomPanel(),
|
|
|
|
|
- new OpenLayers.Control.PanPanel(),
|
|
|
|
|
- new OpenLayers.Control.LayerSwitcher(),
|
|
|
|
|
- new OpenLayers.Control.ScaleLine(),
|
|
|
|
|
- _controlSelectedRecord,
|
|
|
|
|
- // TODO: add box with selected record from table, x for remove selection
|
|
|
|
|
- new OpenLayers.Control.KeyboardDefaults()
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ controls: mapControls,
|
|
|
layers: [gphy,_layer]
|
|
layers: [gphy,_layer]
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -1120,11 +1216,13 @@ var myOpenLayers_Control_SelectedRecord = OpenLayers.Class(OpenLayers.Control, {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function sendAjaxProxy($args) {
|
|
public function sendAjaxProxy($args) {
|
|
|
|
|
+ $wpsServer = null;
|
|
|
$url = V::get('url', '', $args);
|
|
$url = V::get('url', '', $args);
|
|
|
// 1. http%3A%2F%2Fbiuro.biall-net.pl%2Fwps%3FSERVICE%3DWPS%26REQUEST%3DGetCapabilities
|
|
// 1. http%3A%2F%2Fbiuro.biall-net.pl%2Fwps%3FSERVICE%3DWPS%26REQUEST%3DGetCapabilities
|
|
|
// 2. http%3A%2F%2Fbiuro.biall-net.pl%2Fwps%3FSERVICE%3DWPS%26REQUEST%3DDescribeProcess%26VERSION%3D1.0.0%26IDENTIFIER%3Dpozdrawiam
|
|
// 2. http%3A%2F%2Fbiuro.biall-net.pl%2Fwps%3FSERVICE%3DWPS%26REQUEST%3DDescribeProcess%26VERSION%3D1.0.0%26IDENTIFIER%3Dpozdrawiam
|
|
|
header('Content-Type: application/xml; charset=utf-8');
|
|
header('Content-Type: application/xml; charset=utf-8');
|
|
|
$urlParts = parse_url($url);
|
|
$urlParts = parse_url($url);
|
|
|
|
|
+ $urlPath = V::get('path', '', $urlParts);
|
|
|
$urlQuery = array();
|
|
$urlQuery = array();
|
|
|
$urlQueryTmp = V::get('query', '', $urlParts);
|
|
$urlQueryTmp = V::get('query', '', $urlParts);
|
|
|
$urlQueryTmp = explode('&', $urlQueryTmp);
|
|
$urlQueryTmp = explode('&', $urlQueryTmp);
|
|
@@ -1132,8 +1230,27 @@ var myOpenLayers_Control_SelectedRecord = OpenLayers.Class(OpenLayers.Control, {
|
|
|
$parts = explode('=', $vQuery, 2);
|
|
$parts = explode('=', $vQuery, 2);
|
|
|
$urlQuery[$parts[0]] = $parts[1];
|
|
$urlQuery[$parts[0]] = $parts[1];
|
|
|
}
|
|
}
|
|
|
|
|
+ $urlPath = explode('/', trim($urlPath, "/ \n\t\r\0\x0B"));
|
|
|
|
|
+ if (count($urlPath) > 2) {// /wps/21176/BABIDOL_DXF_SHP
|
|
|
|
|
+ if ($urlPath[1] == '21176' && $urlPath[2] == 'BABIDOL_DXF_SHP') {
|
|
|
|
|
+ $tableId = $urlPath[1];
|
|
|
|
|
+ $userAcl = User::getAcl();
|
|
|
|
|
+ $userAcl->fetchGroups();
|
|
|
|
|
+ if (!$userAcl->hasTableAcl($tableId)) {
|
|
|
|
|
+ die('403 Forbidden');
|
|
|
|
|
+ }
|
|
|
|
|
+ $tblAcl = $userAcl->getTableAcl($tableId);
|
|
|
|
|
+ if (!$tblAcl) {
|
|
|
|
|
+ die('404 Not Found');
|
|
|
|
|
+ }
|
|
|
|
|
+ $tblAcl->init();
|
|
|
|
|
+ $wpsServer = new TableAjaxMapWpsServer($tblAcl);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- $wpsServer = new TableAjaxMapWpsServer($this->_acl);
|
|
|
|
|
|
|
+ if (!$wpsServer) {
|
|
|
|
|
+ $wpsServer = new TableAjaxMapWpsServer($this->_acl);
|
|
|
|
|
+ }
|
|
|
if ('WPS' == V::get('SERVICE', '', $urlQuery)) {
|
|
if ('WPS' == V::get('SERVICE', '', $urlQuery)) {
|
|
|
$req = V::get('REQUEST', '', $urlQuery);
|
|
$req = V::get('REQUEST', '', $urlQuery);
|
|
|
$methodName = "{$req}Action";
|
|
$methodName = "{$req}Action";
|
|
@@ -1262,7 +1379,7 @@ class TableAjaxMapWfsAction {
|
|
|
$dataSource->setColTypes($this->_acl->getTypes());
|
|
$dataSource->setColTypes($this->_acl->getTypes());
|
|
|
|
|
|
|
|
$params = array();
|
|
$params = array();
|
|
|
- $params['limit'] = 1000;
|
|
|
|
|
|
|
+ $params['limit'] = 10000;
|
|
|
if (!empty($args['BBOX'])) {
|
|
if (!empty($args['BBOX'])) {
|
|
|
$params['f_the_geom'] = 'BBOX:' . implode(',', $args['BBOX']);
|
|
$params['f_the_geom'] = 'BBOX:' . implode(',', $args['BBOX']);
|
|
|
}
|
|
}
|