diff --git a/delete_data.php b/delete_data.php new file mode 100644 index 0000000..f47a5db --- /dev/null +++ b/delete_data.php @@ -0,0 +1,48 @@ + query("DELETE FROM buildings WHERE webgis_id = '$webgis_id'"); + + } catch (PDOException $e) { + echo "ERROR ".$e->getMessage(); + } + } + + if ($request == 'pipelines') { + $webgis_id = htmlspecialchars($_POST['webgis_id'], ENT_QUOTES); + + try { + + $pdo -> query("DELETE from pipelines where webgis_id= '$webgis_id' "); + + } catch(PDOException $e) { + echo "ERROR ".$e->getMessage(); + } + } + + if ($request == 'valves') { + $webgis_id = htmlspecialchars($_POST['webgis_id'], ENT_QUOTES); + + try { + + $pdo -> query("DELETE from valves where webgis_id= '$webgis_id' "); + + } catch(PDOException $e) { + echo "ERROR ".$e->getMessage(); + } + } + +?> \ No newline at end of file diff --git a/find_data.php b/find_data.php new file mode 100644 index 0000000..7c9fac9 --- /dev/null +++ b/find_data.php @@ -0,0 +1,52 @@ + query("SELECT *, ST_AsGeoJSON(geom) as geojson FROM $table WHERE $field = '$value'"); + + $features = []; + + foreach($result as $row) { + // PHP-Objekt erstellen + $geometry = json_decode($row['geojson']); + + // PHP-Objekt bereinigen + unset($row['geom']); + unset($row['geojson']); + + // JSON-Feature hinzufügen + $feature = [ + "type"=>"Feature", + "geometry"=>$geometry, + "properties"=>$row + ]; + + array_push($features, $feature); + }; + + // Feature-Collection hinzufügen + $featureCollection = [ + "type"=>"FeatureCollection", + "features"=>$features + ]; + + echo json_encode($featureCollection); + + // Fehlernachricht ausgeben + } catch(PDOException $e) { + echo "ERROR ".$e->getMessage(); + + } + +?> \ No newline at end of file diff --git a/index.php b/index.php index 66f7713..b3c82c1 100644 --- a/index.php +++ b/index.php @@ -1,56 +1,1631 @@ - PDO::ERRMODE_EXCEPTION]); - - if ($pdo) { - echo "
PostGIS Version: " . $version[0] . "
"; - } -} catch (PDOException $e) { - echo "" . $e->getMessage() . "
"; -} -?> - - - - - - PDO::ERRMODE_EXCEPTION, - // PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, - // PDO::ATTR_EMULATE_PREPARES => false - // ]; - - - // $dsn = "pgsql:host=localhost;dbname=getenv('POSTGRES_DB');port=5432"; - // $pdo = new PDO($dsn, getenv('POSTGRES_USER'), 'getenv('POSTGRES_PASSWORD'), $opt); - - - // } catch(PDOException $e) { - // echo "Error: ".$e->getMessage(); - // } -?> - + + + + + + + + +
+
+
+
+
+## [Leaflet](http://leafletjs.com/)
+
+ 
+
+Example code at [`examples/index.html`](examples/index.html) ([Preview](http://turbo87.github.io/sidebar-v2/examples/index.html))
+
+
+## [OpenLayers 3](http://openlayers.org/)
+
+ 
+
+Example code at [`examples/ol3.html`](examples/ol3.html) ([Preview](http://turbo87.github.io/sidebar-v2/examples/ol3.html))
+
+
+## [OpenLayers 2](http://openlayers.org/two/)
+
+ 
+
+Example code at [`examples/ol2.html`](examples/ol2.html) ([Preview](http://turbo87.github.io/sidebar-v2/examples/ol2.html))
+
+
+## [Google Maps](https://developers.google.com/maps/)
+
+ 
+
+Example code at [`examples/gmaps.html`](examples/gmaps.html) ([Preview](http://turbo87.github.io/sidebar-v2/examples/gmaps.html))
+
+
+## License
+
+sidebar-v2 is free software, and may be redistributed under the [MIT license](LICENSE).
diff --git a/plugins/sidebar-v2-master/sidebar-v2-master/bower.json b/plugins/sidebar-v2-master/sidebar-v2-master/bower.json
new file mode 100644
index 0000000..f95d8f4
--- /dev/null
+++ b/plugins/sidebar-v2-master/sidebar-v2-master/bower.json
@@ -0,0 +1,30 @@
+{
+ "name": "sidebar-v2",
+ "version": "0.3.1",
+ "homepage": "https://github.com/Turbo87/sidebar-v2",
+ "authors": [
+ "Tobias Bieniek
+
+
+
+
+
+
+
+
diff --git a/plugins/sidebar-v2-master/sidebar-v2-master/examples/index.html b/plugins/sidebar-v2-master/sidebar-v2-master/examples/index.html
new file mode 100644
index 0000000..5c99b69
--- /dev/null
+++ b/plugins/sidebar-v2-master/sidebar-v2-master/examples/index.html
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/sidebar-v2-master/sidebar-v2-master/examples/ol2.html b/plugins/sidebar-v2-master/sidebar-v2-master/examples/ol2.html
new file mode 100644
index 0000000..2941474
--- /dev/null
+++ b/plugins/sidebar-v2-master/sidebar-v2-master/examples/ol2.html
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/sidebar-v2-master/sidebar-v2-master/examples/ol3.html b/plugins/sidebar-v2-master/sidebar-v2-master/examples/ol3.html
new file mode 100644
index 0000000..0bd3d90
--- /dev/null
+++ b/plugins/sidebar-v2-master/sidebar-v2-master/examples/ol3.html
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/sidebar-v2-master/sidebar-v2-master/examples/position-right.html b/plugins/sidebar-v2-master/sidebar-v2-master/examples/position-right.html
new file mode 100644
index 0000000..19962fe
--- /dev/null
+++ b/plugins/sidebar-v2-master/sidebar-v2-master/examples/position-right.html
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/sidebar-v2-master/sidebar-v2-master/gulpfile.js b/plugins/sidebar-v2-master/sidebar-v2-master/gulpfile.js
new file mode 100644
index 0000000..d0565df
--- /dev/null
+++ b/plugins/sidebar-v2-master/sidebar-v2-master/gulpfile.js
@@ -0,0 +1,39 @@
+var gulp = require('gulp');
+var cleanCSS = require('gulp-clean-css');
+var sass = require('gulp-sass');
+var rename = require('gulp-rename');
+var uglify = require('gulp-uglify');
+
+// SASS compilation
+gulp.task('sass', function() {
+ return gulp.src('scss/*sidebar.scss')
+ .pipe(sass())
+ .on('error', sass.logError)
+ .pipe(gulp.dest('css'));
+});
+
+// Minify JS + CSS
+gulp.task('minify:js', function() {
+ return gulp.src('js/*sidebar.js')
+ .pipe(rename({ suffix: '.min' }))
+ .pipe(uglify())
+ .pipe(gulp.dest('js'));
+});
+
+gulp.task('minify:css', gulp.series('sass', function() {
+ return gulp.src('css/*sidebar.css')
+ .pipe(rename({ suffix: '.min' }))
+ .pipe(cleanCSS({level: 2}))
+ .pipe(gulp.dest('css'));
+}));
+
+gulp.task('minify', gulp.parallel('minify:js', 'minify:css'));
+
+// Watch JS + CSS Files
+gulp.task('watch', gulp.series('minify', function() {
+ gulp.watch('js/*.js', ['minify:js']);
+ gulp.watch('scss/*.scss', ['minify:css']);
+}));
+
+// Default
+gulp.task('default', gulp.series('minify'));
diff --git a/plugins/sidebar-v2-master/sidebar-v2-master/js/jquery-sidebar.js b/plugins/sidebar-v2-master/sidebar-v2-master/js/jquery-sidebar.js
new file mode 100644
index 0000000..3166a9e
--- /dev/null
+++ b/plugins/sidebar-v2-master/sidebar-v2-master/js/jquery-sidebar.js
@@ -0,0 +1,84 @@
+/* global $ */
+
+/**
+ * Create a new sidebar on this jQuery object.
+ *
+ * @example
+ * var sidebar = $('#sidebar').sidebar();
+ *
+ * @param {Object} [options] - Optional options object
+ * @param {string} [options.position=left] - Position of the sidebar: 'left' or 'right'
+ * @returns {jQuery}
+ */
+$.fn.sidebar = function(options) {
+ var $sidebar = this;
+ var $tabs = $sidebar.find('ul.sidebar-tabs, .sidebar-tabs > ul');
+ var $container = $sidebar.children('.sidebar-content').first();
+
+ options = $.extend({
+ position: 'left'
+ }, options || {});
+
+ $sidebar.addClass('sidebar-' + options.position);
+
+ $tabs.children('li').children('a[href^="#"]').on('click', function(e) {
+ e.preventDefault();
+ var $tab = $(this).closest('li');
+
+ if ($tab.hasClass('active'))
+ $sidebar.close();
+ else if (!$tab.hasClass('disabled'))
+ $sidebar.open(this.hash.slice(1), $tab);
+ });
+
+ $sidebar.find('.sidebar-close').on('click', function() {
+ $sidebar.close();
+ });
+
+ /**
+ * Open sidebar (if necessary) and show the specified tab.
+ *
+ * @param {string} id - The id of the tab to show (without the # character)
+ * @param {jQuery} [$tab] - The jQuery object representing the tab node (used internally for efficiency)
+ */
+ $sidebar.open = function(id, $tab) {
+ if (typeof $tab === 'undefined')
+ $tab = $tabs.find('li > a[href="#' + id + '"]').parent();
+
+ // hide old active contents
+ $container.children('.sidebar-pane.active').removeClass('active');
+
+ // show new content
+ $container.children('#' + id).addClass('active');
+
+ // remove old active highlights
+ $tabs.children('li.active').removeClass('active');
+
+ // set new highlight
+ $tab.addClass('active');
+
+ $sidebar.trigger('content', { 'id': id });
+
+ if ($sidebar.hasClass('collapsed')) {
+ // open sidebar
+ $sidebar.trigger('opening');
+ $sidebar.removeClass('collapsed');
+ }
+ };
+
+ /**
+ * Close the sidebar (if necessary).
+ */
+ $sidebar.close = function() {
+ // remove old active highlights
+ $tabs.children('li.active').removeClass('active');
+
+ if (!$sidebar.hasClass('collapsed')) {
+ // close sidebar
+ $sidebar.trigger('closing');
+ $sidebar.addClass('collapsed');
+ }
+ };
+
+ return $sidebar;
+};
diff --git a/plugins/sidebar-v2-master/sidebar-v2-master/js/jquery-sidebar.min.js b/plugins/sidebar-v2-master/sidebar-v2-master/js/jquery-sidebar.min.js
new file mode 100644
index 0000000..658df70
--- /dev/null
+++ b/plugins/sidebar-v2-master/sidebar-v2-master/js/jquery-sidebar.min.js
@@ -0,0 +1 @@
+$.fn.sidebar=function(e){var s=this,i=s.find("ul.sidebar-tabs, .sidebar-tabs > ul"),a=s.children(".sidebar-content").first();return e=$.extend({position:"left"},e||{}),s.addClass("sidebar-"+e.position),i.children("li").children('a[href^="#"]').on("click",function(e){e.preventDefault();var i=$(this).closest("li");i.hasClass("active")?s.close():i.hasClass("disabled")||s.open(this.hash.slice(1),i)}),s.find(".sidebar-close").on("click",function(){s.close()}),s.open=function(e,l){void 0===l&&(l=i.find('li > a[href="#'+e+'"]').parent()),a.children(".sidebar-pane.active").removeClass("active"),a.children("#"+e).addClass("active"),i.children("li.active").removeClass("active"),l.addClass("active"),s.trigger("content",{id:e}),s.hasClass("collapsed")&&(s.trigger("opening"),s.removeClass("collapsed"))},s.close=function(){i.children("li.active").removeClass("active"),s.hasClass("collapsed")||(s.trigger("closing"),s.addClass("collapsed"))},s};
\ No newline at end of file
diff --git a/plugins/sidebar-v2-master/sidebar-v2-master/js/leaflet-sidebar.js b/plugins/sidebar-v2-master/sidebar-v2-master/js/leaflet-sidebar.js
new file mode 100644
index 0000000..01060fc
--- /dev/null
+++ b/plugins/sidebar-v2-master/sidebar-v2-master/js/leaflet-sidebar.js
@@ -0,0 +1,216 @@
+/* global L */
+
+/**
+ * @name Sidebar
+ * @class L.Control.Sidebar
+ * @extends L.Control
+ * @param {string} id - The id of the sidebar element (without the # character)
+ * @param {Object} [options] - Optional options object
+ * @param {string} [options.position=left] - Position of the sidebar: 'left' or 'right'
+ * @see L.control.sidebar
+ */
+L.Control.Sidebar = L.Control.extend(/** @lends L.Control.Sidebar.prototype */ {
+ includes: (L.Evented.prototype || L.Mixin.Events),
+
+ options: {
+ position: 'left'
+ },
+
+ initialize: function (id, options) {
+ var i, child;
+
+ L.setOptions(this, options);
+
+ // Find sidebar HTMLElement
+ this._sidebar = L.DomUtil.get(id);
+
+ // Attach .sidebar-left/right class
+ L.DomUtil.addClass(this._sidebar, 'sidebar-' + this.options.position);
+
+ // Attach touch styling if necessary
+ if (L.Browser.touch)
+ L.DomUtil.addClass(this._sidebar, 'leaflet-touch');
+
+ // Find sidebar > div.sidebar-content
+ for (i = this._sidebar.children.length - 1; i >= 0; i--) {
+ child = this._sidebar.children[i];
+ if (child.tagName == 'DIV' &&
+ L.DomUtil.hasClass(child, 'sidebar-content'))
+ this._container = child;
+ }
+
+ // Find sidebar ul.sidebar-tabs > li, sidebar .sidebar-tabs > ul > li
+ this._tabitems = this._sidebar.querySelectorAll('ul.sidebar-tabs > li, .sidebar-tabs > ul > li');
+ for (i = this._tabitems.length - 1; i >= 0; i--) {
+ this._tabitems[i]._sidebar = this;
+ }
+
+ // Find sidebar > div.sidebar-content > div.sidebar-pane
+ this._panes = [];
+ this._closeButtons = [];
+ for (i = this._container.children.length - 1; i >= 0; i--) {
+ child = this._container.children[i];
+ if (child.tagName == 'DIV' &&
+ L.DomUtil.hasClass(child, 'sidebar-pane')) {
+ this._panes.push(child);
+
+ var closeButtons = child.querySelectorAll('.sidebar-close');
+ for (var j = 0, len = closeButtons.length; j < len; j++)
+ this._closeButtons.push(closeButtons[j]);
+ }
+ }
+ },
+
+ /**
+ * Add this sidebar to the specified map.
+ *
+ * @param {L.Map} map
+ * @returns {Sidebar}
+ */
+ addTo: function (map) {
+ var i, child;
+
+ this._map = map;
+
+ for (i = this._tabitems.length - 1; i >= 0; i--) {
+ child = this._tabitems[i];
+ var sub = child.querySelector('a');
+ if (sub.hasAttribute('href') && sub.getAttribute('href').slice(0,1) == '#') {
+ L.DomEvent
+ .on(sub, 'click', L.DomEvent.preventDefault )
+ .on(sub, 'click', this._onClick, child);
+ }
+ }
+
+ for (i = this._closeButtons.length - 1; i >= 0; i--) {
+ child = this._closeButtons[i];
+ L.DomEvent.on(child, 'click', this._onCloseClick, this);
+ }
+
+ return this;
+ },
+
+ /**
+ * @deprecated - Please use remove() instead of removeFrom(), as of Leaflet 0.8-dev, the removeFrom() has been replaced with remove()
+ * Removes this sidebar from the map.
+ * @param {L.Map} map
+ * @returns {Sidebar}
+ */
+ removeFrom: function(map) {
+ console.log('removeFrom() has been deprecated, please use remove() instead as support for this function will be ending soon.');
+ this.remove(map);
+ },
+
+ /**
+ * Remove this sidebar from the map.
+ *
+ * @param {L.Map} map
+ * @returns {Sidebar}
+ */
+ remove: function (map) {
+ var i, child;
+
+ this._map = null;
+
+ for (i = this._tabitems.length - 1; i >= 0; i--) {
+ child = this._tabitems[i];
+ L.DomEvent.off(child.querySelector('a'), 'click', this._onClick);
+ }
+
+ for (i = this._closeButtons.length - 1; i >= 0; i--) {
+ child = this._closeButtons[i];
+ L.DomEvent.off(child, 'click', this._onCloseClick, this);
+ }
+
+ return this;
+ },
+
+ /**
+ * Open sidebar (if necessary) and show the specified tab.
+ *
+ * @param {string} id - The id of the tab to show (without the # character)
+ */
+ open: function(id) {
+ var i, child;
+
+ // hide old active contents and show new content
+ for (i = this._panes.length - 1; i >= 0; i--) {
+ child = this._panes[i];
+ if (child.id == id)
+ L.DomUtil.addClass(child, 'active');
+ else if (L.DomUtil.hasClass(child, 'active'))
+ L.DomUtil.removeClass(child, 'active');
+ }
+
+ // remove old active highlights and set new highlight
+ for (i = this._tabitems.length - 1; i >= 0; i--) {
+ child = this._tabitems[i];
+ if (child.querySelector('a').hash == '#' + id)
+ L.DomUtil.addClass(child, 'active');
+ else if (L.DomUtil.hasClass(child, 'active'))
+ L.DomUtil.removeClass(child, 'active');
+ }
+
+ this.fire('content', { id: id });
+
+ // open sidebar (if necessary)
+ if (L.DomUtil.hasClass(this._sidebar, 'collapsed')) {
+ this.fire('opening');
+ L.DomUtil.removeClass(this._sidebar, 'collapsed');
+ }
+
+ return this;
+ },
+
+ /**
+ * Close the sidebar (if necessary).
+ */
+ close: function() {
+ // remove old active highlights
+ for (var i = this._tabitems.length - 1; i >= 0; i--) {
+ var child = this._tabitems[i];
+ if (L.DomUtil.hasClass(child, 'active'))
+ L.DomUtil.removeClass(child, 'active');
+ }
+
+ // close sidebar
+ if (!L.DomUtil.hasClass(this._sidebar, 'collapsed')) {
+ this.fire('closing');
+ L.DomUtil.addClass(this._sidebar, 'collapsed');
+ }
+
+ return this;
+ },
+
+ /**
+ * @private
+ */
+ _onClick: function() {
+ if (L.DomUtil.hasClass(this, 'active'))
+ this._sidebar.close();
+ else if (!L.DomUtil.hasClass(this, 'disabled'))
+ this._sidebar.open(this.querySelector('a').hash.slice(1));
+ },
+
+ /**
+ * @private
+ */
+ _onCloseClick: function () {
+ this.close();
+ }
+});
+
+/**
+ * Creates a new sidebar.
+ *
+ * @example
+ * var sidebar = L.control.sidebar('sidebar').addTo(map);
+ *
+ * @param {string} id - The id of the sidebar element (without the # character)
+ * @param {Object} [options] - Optional options object
+ * @param {string} [options.position=left] - Position of the sidebar: 'left' or 'right'
+ * @returns {Sidebar} A new sidebar instance
+ */
+L.control.sidebar = function (id, options) {
+ return new L.Control.Sidebar(id, options);
+};
diff --git a/plugins/sidebar-v2-master/sidebar-v2-master/js/leaflet-sidebar.min.js b/plugins/sidebar-v2-master/sidebar-v2-master/js/leaflet-sidebar.min.js
new file mode 100644
index 0000000..aadcde9
--- /dev/null
+++ b/plugins/sidebar-v2-master/sidebar-v2-master/js/leaflet-sidebar.min.js
@@ -0,0 +1 @@
+L.Control.Sidebar=L.Control.extend({includes:L.Evented.prototype||L.Mixin.Events,options:{position:"left"},initialize:function(t,s){var i,e;for(L.setOptions(this,s),this._sidebar=L.DomUtil.get(t),L.DomUtil.addClass(this._sidebar,"sidebar-"+this.options.position),L.Browser.touch&&L.DomUtil.addClass(this._sidebar,"leaflet-touch"),i=this._sidebar.children.length-1;i>=0;i--)"DIV"==(e=this._sidebar.children[i]).tagName&&L.DomUtil.hasClass(e,"sidebar-content")&&(this._container=e);for(this._tabitems=this._sidebar.querySelectorAll("ul.sidebar-tabs > li, .sidebar-tabs > ul > li"),i=this._tabitems.length-1;i>=0;i--)this._tabitems[i]._sidebar=this;for(this._panes=[],this._closeButtons=[],i=this._container.children.length-1;i>=0;i--)if("DIV"==(e=this._container.children[i]).tagName&&L.DomUtil.hasClass(e,"sidebar-pane")){this._panes.push(e);for(var o=e.querySelectorAll(".sidebar-close"),a=0,l=o.length;a