@vidro/map-handler 1.0.4 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +326 -118
- package/dist/map-handler.js +1 -1
- package/doc/giswater.png +0 -0
- package/doc/giswaterInfo.png +0 -0
- package/doc/giswaterInfoApi.png +0 -0
- package/doc/giswatergeojson.png +0 -0
- package/doc/multiTile.png +0 -0
- package/doc/multiTileNoGutter.png +0 -0
- package/doc/togglelayergiswater.png +0 -0
- package/doc/vidromaps-basic.png +0 -0
- package/examples/externalwms/index.js +20 -0
- package/examples/externalwms/index.php +88 -0
- package/examples/full/apidemo.js +54 -11
- package/examples/full/cachedToken.dat +1 -1
- package/examples/full/cachedTokenData.dat +1 -1
- package/examples/full/index.php +37 -18
- package/examples/full/tester.js +177 -13
- package/examples/integration/tool/css/dist/home.css.min.css +0 -0
- package/examples/integration/tool/css/dist/home.min.css +1 -0
- package/examples/integration/tool/css/dist/home.min.css.map +10 -0
- package/examples/integration/tool/css/dist/style-login.css.min.css +0 -0
- package/examples/integration/tool/css/dist/style-login.min.css +1 -0
- package/examples/integration/tool/css/dist/style-login.min.css.map +10 -0
- package/examples/integration/tool/css/dist/style.css.min.css +0 -0
- package/examples/integration/tool/css/dist/style.min.css +1 -0
- package/examples/integration/tool/css/dist/style.min.css.map +23 -0
- package/examples/integration/tool/css/master/_bottom-sheet-2.scss +103 -0
- package/examples/integration/tool/css/master/_bottom-sheet.scss +142 -0
- package/examples/integration/tool/css/master/_colors.scss +35 -0
- package/examples/integration/tool/css/master/_dropdown-form.scss +167 -0
- package/examples/integration/tool/css/master/_forms.scss +416 -0
- package/examples/integration/tool/css/master/_header.scss +134 -0
- package/examples/integration/tool/css/master/_menu-toc.scss +135 -0
- package/examples/integration/tool/css/master/_menu-tools.scss +187 -0
- package/examples/integration/tool/css/master/_mixins.scss +42 -0
- package/examples/integration/tool/css/master/_notifyjs.scss +39 -0
- package/examples/integration/tool/css/master/_ol-map-controls.scss +117 -0
- package/examples/integration/tool/css/master/_simplelightbox.scss +287 -0
- package/examples/integration/tool/css/master/_toc-config.scss +28 -0
- package/examples/integration/tool/css/master/_toc-layouts.scss +173 -0
- package/examples/integration/tool/css/master/_tooltip.scss +34 -0
- package/examples/integration/tool/css/master/home.scss +266 -0
- package/examples/integration/tool/css/master/style-login.scss +240 -0
- package/examples/integration/tool/css/master/style.scss +166 -0
- package/examples/integration/tool/img/doc-gallery-placeholder.svg +3 -0
- package/examples/integration/tool/img/home/ic_calendar-clock.svg +1 -0
- package/examples/integration/tool/img/home/ic_caret-down.svg +1 -0
- package/examples/integration/tool/img/home/ic_cog.svg +1 -0
- package/examples/integration/tool/img/home/ic_marker.svg +1 -0
- package/examples/integration/tool/img/home/ic_play-circle.svg +1 -0
- package/examples/integration/tool/img/home/ic_power.svg +1 -0
- package/examples/integration/tool/img/home/ic_squares.svg +1 -0
- package/examples/integration/tool/img/home/ic_user-pointer.svg +1 -0
- package/examples/integration/tool/img/home/ic_user-square.svg +1 -0
- package/examples/integration/tool/img/home/logo_footer.svg +1 -0
- package/examples/integration/tool/img/ic/accessControl.svg +1 -0
- package/examples/integration/tool/img/ic/account-location.svg +1 -0
- package/examples/integration/tool/img/ic/actionDelete.svg +64 -0
- package/examples/integration/tool/img/ic/actionOpen.svg +64 -0
- package/examples/integration/tool/img/ic/addFile.svg +100 -0
- package/examples/integration/tool/img/ic/addFile_off.svg +102 -0
- package/examples/integration/tool/img/ic/arrow-left.svg +1 -0
- package/examples/integration/tool/img/ic/arrow-right-drop-circle-outline.svg +1 -0
- package/examples/integration/tool/img/ic/bt_add_photo.svg +3 -0
- package/examples/integration/tool/img/ic/bug.svg +1 -0
- package/examples/integration/tool/img/ic/caret-down-bottomsheet.svg +3 -0
- package/examples/integration/tool/img/ic/checkbox-blank-outline-grey.svg +8 -0
- package/examples/integration/tool/img/ic/checkbox-blank-outline-white.svg +8 -0
- package/examples/integration/tool/img/ic/checkbox-blank-outline.svg +1 -0
- package/examples/integration/tool/img/ic/checkbox-marked-outline-grey.svg +8 -0
- package/examples/integration/tool/img/ic/checkbox-marked-outline-white.svg +8 -0
- package/examples/integration/tool/img/ic/checkbox-marked-outline.svg +1 -0
- package/examples/integration/tool/img/ic/chevron-down-grey.svg +7 -0
- package/examples/integration/tool/img/ic/chevron-down-white.svg +7 -0
- package/examples/integration/tool/img/ic/chevron-down.svg +1 -0
- package/examples/integration/tool/img/ic/chevron-right-grey.svg +7 -0
- package/examples/integration/tool/img/ic/chevron-right-white.svg +7 -0
- package/examples/integration/tool/img/ic/chevron-right.svg +1 -0
- package/examples/integration/tool/img/ic/comment-text-outline.svg +1 -0
- package/examples/integration/tool/img/ic/cookie.svg +1 -0
- package/examples/integration/tool/img/ic/delete.svg +1 -0
- package/examples/integration/tool/img/ic/dot.svg +1 -0
- package/examples/integration/tool/img/ic/dump.svg +1 -0
- package/examples/integration/tool/img/ic/e.svg +9 -0
- package/examples/integration/tool/img/ic/eye-off.svg +1 -0
- package/examples/integration/tool/img/ic/eye.svg +1 -0
- package/examples/integration/tool/img/ic/forbidden.svg +1 -0
- package/examples/integration/tool/img/ic/form-title-1.svg +3 -0
- package/examples/integration/tool/img/ic/group.svg +1 -0
- package/examples/integration/tool/img/ic/hamburger.svg +1 -0
- package/examples/integration/tool/img/ic/ic-users.svg +1 -0
- package/examples/integration/tool/img/ic/ic_dropdown-form-close.svg +3 -0
- package/examples/integration/tool/img/ic/ic_dropdown-form-link.svg +3 -0
- package/examples/integration/tool/img/ic/ic_feature-edit-cancel.svg +14 -0
- package/examples/integration/tool/img/ic/ic_feature-edit-save.svg +14 -0
- package/examples/integration/tool/img/ic/ic_gallery-item-delete.svg +3 -0
- package/examples/integration/tool/img/ic/ic_gallery-item-view.svg +3 -0
- package/examples/integration/tool/img/ic/ic_gps.svg +3 -0
- package/examples/integration/tool/img/ic/ic_search.svg +5 -0
- package/examples/integration/tool/img/ic/ic_selector_fechas.svg +63 -0
- package/examples/integration/tool/img/ic/ic_zoom-to-extent.svg +3 -0
- package/examples/integration/tool/img/ic/icon_reminder.png +0 -0
- package/examples/integration/tool/img/ic/image-gallery-placeholder.svg +55 -0
- package/examples/integration/tool/img/ic/imaqua.svg +87 -0
- package/examples/integration/tool/img/ic/incidencia.svg +77 -0
- package/examples/integration/tool/img/ic/info_multi_selection.svg +230 -0
- package/examples/integration/tool/img/ic/layers.svg +1 -0
- package/examples/integration/tool/img/ic/map-marker.svg +3 -0
- package/examples/integration/tool/img/ic/map.svg +1 -0
- package/examples/integration/tool/img/ic/measure_area.svg +111 -0
- package/examples/integration/tool/img/ic/minus.svg +7 -0
- package/examples/integration/tool/img/ic/notification.svg +1 -0
- package/examples/integration/tool/img/ic/offline.svg +3 -0
- package/examples/integration/tool/img/ic/online.svg +1 -0
- package/examples/integration/tool/img/ic/pencil.svg +3 -0
- package/examples/integration/tool/img/ic/plus.svg +1 -0
- package/examples/integration/tool/img/ic/polygon_selection.svg +68 -0
- package/examples/integration/tool/img/ic/power.svg +1 -0
- package/examples/integration/tool/img/ic/remoteLocalized.svg +4 -0
- package/examples/integration/tool/img/ic/remoteStartLocalize.svg +4 -0
- package/examples/integration/tool/img/ic/ruler.svg +125 -0
- package/examples/integration/tool/img/ic/selection-plus.svg +10 -0
- package/examples/integration/tool/img/ic/selection.svg +1 -0
- package/examples/integration/tool/img/ic/settings.svg +1 -0
- package/examples/integration/tool/img/ic/sort.svg +1 -0
- package/examples/integration/tool/img/ic/sort_asc.svg +1 -0
- package/examples/integration/tool/img/ic/sort_desc.svg +1 -0
- package/examples/integration/tool/img/ic/spreadsheet.svg +3 -0
- package/examples/integration/tool/img/ic/times.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/AB3.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/AB4.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/IC1.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/TB1.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/TB11.svg +5 -0
- package/examples/integration/tool/img/ic/toolbar/TB2.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/TB20.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/TB21.svg +54 -0
- package/examples/integration/tool/img/ic/toolbar/TB3.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/TB31.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/TB32.svg +57 -0
- package/examples/integration/tool/img/ic/toolbar/TB4.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/TB5.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/TB6.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/TB7.svg +1 -0
- package/examples/integration/tool/img/ic/toolbar/TB8.svg +1 -0
- package/examples/integration/tool/img/ic/tools.svg +28 -0
- package/examples/integration/tool/img/ic/user.svg +1 -0
- package/examples/integration/tool/img/ic/vector-polygon.svg +1 -0
- package/examples/integration/tool/img/ic/visit_manager.svg +135 -0
- package/examples/integration/tool/img/logo-footer-login.png +0 -0
- package/examples/integration/tool/img/logo-footer.png +0 -0
- package/examples/integration/tool/img/logo-header-login.png +0 -0
- package/examples/integration/tool/img/logo-header-login@2x.png +0 -0
- package/examples/integration/tool/img/logo-header-login@3x.png +0 -0
- package/examples/integration/tool/img/logo-header.png +0 -0
- package/examples/integration/tool/img/logo-header@2x.png +0 -0
- package/examples/integration/tool/img/logo-header@3x.png +0 -0
- package/examples/integration/tool/img/logo_project.png +0 -0
- package/examples/integration/tool/img/photo-gallery-placeholder.svg +3 -0
- package/examples/integration/tool/img/pixel.png +0 -0
- package/examples/integration/tool/index.html +228 -0
- package/examples/integration/tool/js/demo.js +238 -0
- package/examples/integration/tool/js/interface.js +147 -0
- package/examples/integration/tool/js/jquery.js +4 -0
- package/examples/integration/vanguardia.html +6636 -0
- package/examples/multipleIframes/index.js +82 -0
- package/examples/multipleIframes/index.php +52 -0
- package/examples/serverLess/dist/index.23420cfa.js +2973 -0
- package/examples/serverLess/dist/index.23420cfa.js.map +1 -0
- package/examples/serverLess/dist/index.91b6cacc.js +2 -0
- package/examples/serverLess/dist/index.91b6cacc.js.map +1 -0
- package/examples/serverLess/dist/index.html +1 -0
- package/examples/serverLess/index.html +39 -0
- package/examples/serverLess/main.js +113 -0
- package/examples/serverLess/package.json +18 -0
- package/examples/serverLess/readme.md +41 -0
- package/examples/simple/index.html +1 -1
- package/examples/simple/simple.js +63 -65
- package/examples/vidromap/index.js +20 -0
- package/examples/vidromap/index.php +48 -51
- package/flows.md +73 -0
- package/package.json +2 -2
- package/src/index.js +156 -42
- package/src/shared/iframe-communicator.js +12 -5
- package/examples/vidromap/vidromap.js +0 -87
package/dist/map-handler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VidroMaps=t():e.VidroMaps=t()}(self,(function(){return(()=>{"use strict";var e={187:e=>{var t,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,o){function r(n){e.removeListener(t,i),o(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,r)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,o){var r,i,s,c;if(a(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),void 0===s)s=i[t]=n,++e._eventsCount;else if("function"==typeof s?s=i[t]=o?[n,s]:[s,n]:o?s.unshift(n):s.push(n),(r=u(e))>0&&s.length>r&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=s.length,c=f,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=f.bind(o);return r.listener=n,o.wrapFn=r,r}function p(e,t,n){var o=e._events;if(void 0===o)return[];var r=o[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):d(r,r.length)}function y(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function d(e,t){for(var n=new Array(t),o=0;o<t;++o)n[o]=e[o];return n}function v(e,t,n,o){if("function"==typeof e.on)o.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function r(i){o.once&&e.removeEventListener(t,r),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return u(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,f=d(u,c);for(n=0;n<c;++n)o(f[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,o,r,i,s;if(a(t),void 0===(o=this._events))return this;if(void 0===(n=o[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,r=i;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(o[e]=n[0]),void 0!==o.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,o;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,i=Object.keys(n);for(o=0;o<i.length;++o)"removeListener"!==(r=i[o])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},i.prototype.listenerCount=y,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{Communicator:()=>l});var e=n(187),t="undefined"==typeof window,r=function(e){t||window.top.frames["map-frame"].postMessage(e,"*")};function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?u(e):t}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(l,e);var t,n,o=(t=l,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,o=c(t);if(n){var r=c(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return a(this,e)});function l(e){var t,n=e.sessionToken;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),f(u(t=o.call(this)),"onMessageReceived",(function(e){switch(e.data.type){case"onZoomChange":t.emit("onZoomChange",e.data.zoom);break;case"geomAdded":t.emit("geomAdded",e.data.geom_astext);break;case"layers":t.emit("layers",e.data.layers);break;case"geoJSONlayers":t.emit("geoJSONlayers",e.data.layers);break;case"info":t.emit("info",e.data);break;case"error":t.emit("error",e.data);break;case"coordinates":t.emit("coordinates",e.data);break;case"activeLayer":t.emit("activeLayer",e.data);break;case"geolocation":t.emit("geolocation",e.data);break;case"WMSInfoAvailable":t.emit("WMSInfoAvailable",e.data);break;case"giswaterTiledBackgroundDisplayed":t.emit("giswaterTiledBackgroundDisplayed",e.data);break;case"giswaterTiledBackgroundAvailable":t.emit("giswaterTiledBackgroundAvailable",e.data);break;case"GiswaterLayerAvailableFilters":t.emit("GiswaterLayerAvailableFilters",e.data)}})),f(u(t),"ZoomIn",(function(){r({type:"zoomIn",sessionToken:t.sessionToken})})),f(u(t),"ZoomOut",(function(){r({type:"zoomOut",sessionToken:t.sessionToken})})),f(u(t),"AddGeom",(function(e){r({type:"AddGeom",geom:e,sessionToken:t.sessionToken})})),f(u(t),"toggleLayer",(function(e){r({type:"toggleLayer",layer:e,sessionToken:t.sessionToken})})),f(u(t),"setActiveLayer",(function(e){r({type:"setActiveLayer",layer:e,sessionToken:t.sessionToken})})),f(u(t),"getActiveLayer",(function(){r({type:"getActiveLayer",sessionToken:t.sessionToken})})),f(u(t),"clear",(function(){r({type:"clear",sessionToken:t.sessionToken})})),f(u(t),"Highlight",(function(e){r({type:"highlight",geom:e.geom,zoom:e.zoom,sessionToken:t.sessionToken})})),f(u(t),"zoomToExtent",(function(){r({type:"zoomToExtent",sessionToken:t.sessionToken})})),f(u(t),"infoFromCoordinates",(function(e,n,o){r({type:"infoFromCoordinates",info:e,layer:void 0===n?null:n,hitTolerance:void 0!==o?parseInt(o):5,sessionToken:t.sessionToken})})),f(u(t),"Geolocalize",(function(e){r({type:"Geolocalize",toggle:e,sessionToken:t.sessionToken})})),f(u(t),"toggleGiswaterTiled",(function(e){r({type:"toggleGiswaterTiled",toggle:e,sessionToken:t.sessionToken})})),f(u(t),"reloadDisplayedLayers",(function(){return r({type:"reloadDisplayedLayers",sessionToken:t.sessionToken})})),f(u(t),"addGeoJSON",(function(e,n,o){return e?r({type:"addGeoJSON",geoJSON:e,options:void 0!==n?n:{fillcolor:null,strokecolor:null},name:o||Math.random().toString(36).substring(7),sessionToken:t.sessionToken}):void t.emit("error",{error:"No geoJSON data"})})),f(u(t),"clearGeoJSON",(function(){return r({type:"clearGeoJSON",sessionToken:t.sessionToken})})),f(u(t),"removeGeoJSONLayer",(function(e){return e?r({type:"removeGeoJSONLayer",name:e,sessionToken:t.sessionToken}):void t.emit("error",{error:"No geoJSON data"})})),f(u(t),"setGiswaterFilters",(function(e){var n=e;if(e){if("object"!=i(e)){e=(e=(e=e.trim()).replace(/^\s+|\s+$/g,"")).replace(/\\/g,"");try{n=JSON.parse(e)}catch(e){return void t.emit("error",{error:"Filters is not a valid JSON"})}}return r({type:"setGiswaterFilters",filters:n,sessionToken:t.sessionToken})}t.emit("error",{error:"No filters"})})),f(u(t),"getGiswaterLayerAvailableFilters",(function(e){return e?r({type:"getGiswaterLayerAvailableFilters",name:e,sessionToken:t.sessionToken}):void t.emit("error",{error:"No layer_name"})})),"undefined"==typeof window?a(t):(window.addEventListener("message",(function(e){return t.onMessageReceived(e)})),t.sessionToken=n,t)}return l}(e.EventEmitter)})(),o})()}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VidroMaps=t():e.VidroMaps=t()}(self,(function(){return(()=>{"use strict";var e={187:e=>{var t,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,o){function r(n){e.removeListener(t,s),o(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}y(e,t,s,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,r)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var i=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function u(e,t,n,o){var r,s,i,u;if(a(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),i=s[t]),void 0===i)i=s[t]=n,++e._eventsCount;else if("function"==typeof i?i=s[t]=o?[n,i]:[i,n]:o?i.unshift(n):i.push(n),(r=l(e))>0&&i.length>r&&!i.warned){i.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=i.length,u=c,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=c.bind(o);return r.listener=n,o.wrapFn=r,r}function f(e,t,n){var o=e._events;if(void 0===o)return[];var r=o[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):m(r,r.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),o=0;o<t;++o)n[o]=e[o];return n}function y(e,t,n,o){if("function"==typeof e.on)o.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function r(s){o.once&&e.removeEventListener(t,r),n(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var l=s[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var u=l.length,c=m(l,u);for(n=0;n<u;++n)o(c[n],this,t)}return!0},s.prototype.addListener=function(e,t){return u(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return u(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,o,r,s,i;if(a(t),void 0===(o=this._events))return this;if(void 0===(n=o[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){i=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(o[e]=n[0]),void 0!==o.removeListener&&this.emit("removeListener",e,i||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,o;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,s=Object.keys(n);for(o=0;o<s.length;++o)"removeListener"!==(r=s[o])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{Communicator:()=>d});var e=n(187),t="undefined"==typeof window,r=function e(n){var o,r,s=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(e){t||window.top.frames[s.domId].postMessage(e,"*")},(o="sendMessageToMap")in this?Object.defineProperty(this,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[o]=r,this.domId="map-frame","string"==typeof n.id&&(this.domId=n.id)};function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?l(e):t}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(d,e);var t,n,o=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,o=u(t);if(n){var r=u(this).constructor;e=Reflect.construct(o,arguments,r)}else e=o.apply(this,arguments);return a(this,e)});function d(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),c(l(t=o.call(this)),"onMessageReceived",(function(e){switch(e.data.type){case"onZoomChange":t.emitEvent("onZoomChange",e.data.zoom,e.data.domId);break;case"geomAdded":t.emitEvent("geomAdded",e.data.geom_astext,e.data.domId);break;case"layers":t.emitEvent("layers",e.data.layers,e.data.domId);break;case"geoJSONlayers":t.emitEvent("geoJSONlayers",e.data.layers,e.data.domId);break;case"info":t.emitEvent("info",e.data,e.data.domId);break;case"error":t.emitEvent("error",e.data,e.data.domId);break;case"coordinates":t.emitEvent("coordinates",e.data,e.data.domId);break;case"activeLayer":t.emitEvent("activeLayer",e.data,e.data.domId);break;case"geolocation":t.emitEvent("geolocation",e.data,e.data.domId);break;case"WMSInfoAvailable":t.emitEvent("WMSInfoAvailable",e.data,e.data.domId);break;case"giswaterTiledBackgroundDisplayed":t.emitEvent("giswaterTiledBackgroundDisplayed",e.data,e.data.domId);break;case"giswaterTiledBackgroundAvailable":t.emitEvent("giswaterTiledBackgroundAvailable",e.data,e.data.domId);break;case"GiswaterLayerAvailableFilters":t.emitEvent("GiswaterLayerAvailableFilters",e.data,e.data.domId);break;case"loaded":t.emitEvent("loaded",e.data,e.data.domId);break;case"availableWMSLayers":t.emitEvent("availableWMSLayers",e.data.layers,e.data.domId)}})),c(l(t),"emitEvent",(function(e,n,o){o===t.domId&&(delete n.domId,t.emit(e,n))})),c(l(t),"ZoomIn",(function(){t.com.sendMessageToMap({type:"zoomIn",sessionToken:t.sessionToken})})),c(l(t),"ZoomOut",(function(){t.com.sendMessageToMap({type:"zoomOut",sessionToken:t.sessionToken})})),c(l(t),"AddGeom",(function(e){t.com.sendMessageToMap({type:"AddGeom",geom:e,sessionToken:t.sessionToken})})),c(l(t),"toggleLayer",(function(e,n){void 0===n&&(n={gutter:null,transparent:null,singletile:null}),null!==n.singletile&&"boolean"!=typeof n.singletile&&(n.singletile=null,t.emit("error",{error:"singleTile must be a Boolean"})),""!==n.gutter&&null!==n.gutter&&(isNaN(parseInt(n.gutter))&&(n.gutter=null,t.emit("error",{error:"Gutter must be a number"})),n.singletile&&(n.gutter=null,t.emit("error",{error:"Gutter can only be user with multitile layers; set singletile to false"}))),null!==n.transparent&&"boolean"!=typeof n.transparent&&(n.transparent=null,t.emit("error",{error:"transparent must be a Boolean"})),t.com.sendMessageToMap({type:"toggleLayer",layer:e,gutter:isNaN(parseInt(n.gutter))?null:parseInt(n.gutter),transparent:n.transparent,singletile:n.singletile,sessionToken:t.sessionToken})})),c(l(t),"setActiveLayer",(function(e){t.com.sendMessageToMap({type:"setActiveLayer",layer:e,sessionToken:t.sessionToken})})),c(l(t),"getActiveLayer",(function(){t.com.sendMessageToMap({type:"getActiveLayer",sessionToken:t.sessionToken})})),c(l(t),"loadWMSAvailableLayers",(function(){t.com.sendMessageToMap({type:"loadWMSAvailableLayers",sessionToken:t.sessionToken})})),c(l(t),"clear",(function(){t.com.sendMessageToMap({type:"clear",sessionToken:t.sessionToken})})),c(l(t),"Highlight",(function(e){t.com.sendMessageToMap({type:"highlight",geom:e.geom,zoom:e.zoom,sessionToken:t.sessionToken})})),c(l(t),"zoomToExtent",(function(){t.com.sendMessageToMap({type:"zoomToExtent",sessionToken:t.sessionToken})})),c(l(t),"zoomToCoordinates",(function(e,n,o){isNaN(parseInt(o))||t.com.sendMessageToMap({type:"zoomToCoordinates",sessionToken:t.sessionToken,coordinates:[e,n],zoomLevel:o})})),c(l(t),"infoFromCoordinates",(function(e,n,o){var r=void 0===n?null:n;t.com.sendMessageToMap({type:"infoFromCoordinates",info:e,layer:r,hitTolerance:void 0!==o?parseInt(o):5,sessionToken:t.sessionToken})})),c(l(t),"Geolocalize",(function(e){t.com.sendMessageToMap({type:"Geolocalize",toggle:e,sessionToken:t.sessionToken})})),c(l(t),"toggleGiswaterTiled",(function(e){t.com.sendMessageToMap({type:"toggleGiswaterTiled",toggle:e,sessionToken:t.sessionToken})})),c(l(t),"reloadDisplayedLayers",(function(){return t.com.sendMessageToMap({type:"reloadDisplayedLayers",sessionToken:t.sessionToken})})),c(l(t),"addGeoJSON",(function(e,n,o){return e?t.com.sendMessageToMap({type:"addGeoJSON",geoJSON:e,options:void 0!==n?n:{fillcolor:null,strokecolor:null},name:o||Math.random().toString(36).substring(7),sessionToken:t.sessionToken}):void t.emit("error",{error:"No geoJSON data"})})),c(l(t),"clearGeoJSON",(function(){return t.com.sendMessageToMap({type:"clearGeoJSON",sessionToken:t.sessionToken})})),c(l(t),"removeGeoJSONLayer",(function(e){return e?t.com.sendMessageToMap({type:"removeGeoJSONLayer",name:e,sessionToken:t.sessionToken}):void t.emit("error",{error:"No geoJSON data"})})),c(l(t),"setGiswaterFilters",(function(e){var n=e;if(e){if("object"!=s(e)){e=(e=(e=e.trim()).replace(/^\s+|\s+$/g,"")).replace(/\\/g,"");try{n=JSON.parse(e)}catch(e){return void t.emit("error",{error:"Filters is not a valid JSON"})}}return t.com.sendMessageToMap({type:"setGiswaterFilters",filters:n,sessionToken:t.sessionToken})}t.emit("error",{error:"No filters"})})),c(l(t),"getGiswaterLayerAvailableFilters",(function(e){return e?t.com.sendMessageToMap({type:"getGiswaterLayerAvailableFilters",name:e,sessionToken:t.sessionToken}):void t.emit("error",{error:"No layer_name"})})),c(l(t),"setDebug",(function(e){isNaN(parseInt(e))?console.error("Debug is not a integer"):t.com.sendMessageToMap({type:"setDebug",what:e,sessionToken:t.sessionToken})})),c(l(t),"setCustomColors",(function(e){if("object"===s(e)){if(e.hasOwnProperty("geom_stroke_width")){if(isNaN(parseInt(e.geom_stroke_width)))return void console.error("geom_stroke_width is not an number");e.geom_stroke_width=parseInt(e.geom_stroke_width)}else e.geom_stroke_width=1;if(e.hasOwnProperty("geom_radius")){if(isNaN(parseInt(e.geom_radius)))return void console.error("geom_stroke_width is not an number");e.geom_radius=parseInt(e.geom_radius)}else e.geom_radius=4;e.hasOwnProperty("geom_shape")&&"circle"!==e.geom_shape&&"square"!==e.geom_shape&&(e.geom_shape="circle",console.error("geom_shape must be either 'circle' or 'square'")),t.com.sendMessageToMap({type:"setCustomColors",properties:e,sessionToken:t.sessionToken})}else console.error("properties is not an object")})),t.domId="map-frame","undefined"==typeof window?a(t):("string"==typeof e.id&&(t.domId=e.id),t.com=new r(e),window.addEventListener("message",(function(e){return t.onMessageReceived(e)})),t.sessionToken=e.sessionToken,t)}return d}(e.EventEmitter)})(),o})()}));
|
package/doc/giswater.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
var sessionToken = document.querySelector("#sessionToken");
|
|
3
|
+
var mapContainer = document.querySelector("#mapContainer");
|
|
4
|
+
var codeContent = document.querySelector("#code");
|
|
5
|
+
var iframesContainer = document.querySelector("#iframes-container");
|
|
6
|
+
|
|
7
|
+
var iframe = document.querySelector("#map-frame");
|
|
8
|
+
var host = document.querySelector("#overrideHost");
|
|
9
|
+
var btLoadIframe = document.querySelector("#btLoadIframe");
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
//************** MAP EXAMPLE
|
|
13
|
+
|
|
14
|
+
if(btLoadIframe){
|
|
15
|
+
btLoadIframe.addEventListener("click", function (evt) {
|
|
16
|
+
if(code.value!=""){
|
|
17
|
+
iframesContainer.innerHTML = code.value;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>🛠️ MAP TESTER - Vidro Map</title>
|
|
4
|
+
<link rel="stylesheet" href="../tester.css"></link>
|
|
5
|
+
<link rel="icon" type="image/png" href="https://www.vidrosoftware.com/favicon/favicon-32x32.png" sizes="32x32" />
|
|
6
|
+
<link rel="icon" type="image/png" href="https://www.vidrosoftware.com/favicon/favicon-16x16.png" sizes="16x16" />
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<div class="form" id="userData">
|
|
13
|
+
<h1>Vidromap</h1>
|
|
14
|
+
|
|
15
|
+
<div id="sessionToken"></div>
|
|
16
|
+
<div>
|
|
17
|
+
Paste your code here:<br> <textarea name="code" id="code" rows="10" cols="100" placeholder=""><iframe id="map-frame" name="map-frame" width="100%" height="600" src="http://localhost:3000?sessionToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2MzIzMzA3MDMsImF1ZCI6IjVkM2Y5NWU3YTg5NjBjYWQ4MWU2OGQ1ZTQzODYzZmRhMGJiOTM5NDUiLCJkYXRhIjp7Inpvb20iOjQsImJhY2tncm91bmQiOiJDYXJ0b0RCTGlnaHQiLCJzcmlkIjoiRVBTRzoyNTgzMSIsImV4dGVudCI6IjQxNzE1MC4wMzEsIDQ1NzYxNjQuMzY0LCA0MjA3MDAuMTg3LCA0NTc4MTExLjczNiIsImdlb3NlcnZpY2UiOm51bGwsIm5hbWUiOiJnZW9qc29uIiwicHJldmlldyI6dHJ1ZSwiYXBpIjoiaHR0cHM6XC9cL2RldmFwaS52aWRyb3NvZnR3YXJlLmNvbVwvIiwidHlwZSI6InZpZHJvbWFwIiwidG9rZW4iOiI4YjNhM2ZjYzM5YzNlMTczOWMzZDcyZGI3ZDg1MDU3MSIsInNob3dfbGF5ZXJzIjoiIiwiaWQiOjE0LCJsb2dvIjoiaHR0cHM6XC9cL3d3dy52aWRyb3NvZnR3YXJlLmNvbVwvbG9nb3NcL1ZJRFJPLnN2ZyJ9fQ.MPaZ956QccNsh8S8G70UwWu93xD-HcUDdk5RufJxrGCBi8gT-LJ-8JiJdd9z8L8vrtZsekdn-h4md9WkLmot8THE8lHl1lFF0DEh_qFdHHxtdHVbp6OfTaQthEU9MBKVXPdB1igTAVtl__uPbM_2u9ItdMhePDNTq8NnzgUhyjMSZW0uj-dq5Yli2xL4NY8BYkiEHLdF8kbpcyjyenH0c2-GV8JnAEFz3rxNdv7d0guvaADMer2DpJzstkKFCWKZtqJbBYq9j0sZ4Ypzsh9YK3lSqAoDeg-VyszRMFHfr9JWXkt2iy4s0FSAOG11HKDQcLMUkjPlPWMtDT92NDbjWH5ZLBHjuPklO1HX77QIcON1z1HjNVq5fqMSnXK_s0dniRmIp9W6FM9rv012aP61v7_VA6LwSEw6zAK7mlL686HmLGtHQ5emG-EzwJLQMGaZ-VgDSWnSntA5QNU1B0R4lhwlmEuEMAgGjI7aNh2q4BlqgZC2uDszjtyteOwdlxRn3M6zjv3W22_qaJA2mnQI7cDwMqbYRDZ7R4uUCEMyTxLk26QOa0lYsj3ZYCiBSC2LlQFeJu7XuKrHtR-9B6Q2bYq1c5ht6cqxIBPBoZPV0V3FnmFX8cU3AJUEUDNJ4m9KhwBsTFW9yJV5gfM-56zGIh09COxSJAhrqCRcEzSHMpk"></iframe></textarea>
|
|
18
|
+
</div>
|
|
19
|
+
<div>
|
|
20
|
+
External wms url: <input type="text" name="service_uri" id="service_uri" size="55" value="https://nv.napr.gov.ge/geoserver/wms" placeholder="https://nv.napr.gov.ge/geoserver/wms">
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div>
|
|
24
|
+
Debug
|
|
25
|
+
<button id="btDebug">Debug</button>
|
|
26
|
+
<select id="debug">
|
|
27
|
+
<option id="1" selected value=1>Show logs</option>
|
|
28
|
+
<option id="0" value=0>Hide logs</option>
|
|
29
|
+
</select> <small>Show/hide component logs</small>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div>
|
|
33
|
+
<button id="btLoadIframe">Load Map</button> -
|
|
34
|
+
<button id="btLoadWMSLayers">Load layers from wms</button>
|
|
35
|
+
</div>
|
|
36
|
+
<div id="Error_container"></div>
|
|
37
|
+
<div id="mapContainer">
|
|
38
|
+
|
|
39
|
+
<div id="iframes-container">
|
|
40
|
+
|
|
41
|
+
</div>
|
|
42
|
+
<hr />
|
|
43
|
+
<pre id="Result_container"></pre>
|
|
44
|
+
<hr/>
|
|
45
|
+
<h2>Zoom</h2>
|
|
46
|
+
<button id="btZoomIn">Zoom In</button>
|
|
47
|
+
<button id="btZoomOut">Zoom Out</button>
|
|
48
|
+
<button id="btZoomToExtent">Zoom to extent</button>
|
|
49
|
+
<br><br>
|
|
50
|
+
<button id="btZoomToCoordinates">Zoom to coordinates</button>
|
|
51
|
+
ZoomToCoordinates level: <input type="text" name="zoomLevelToCoordinates" id="zoomLevelToCoordinates" size="5" value="4">
|
|
52
|
+
<h2>Add geometry</h2>
|
|
53
|
+
<button id="btAddPoint">Add point</button>
|
|
54
|
+
<button id="btAddPolygon">Add polygon</button>
|
|
55
|
+
<button id="btAddLine">Add line</button>
|
|
56
|
+
<button id="btClear">Clear geometries</button>
|
|
57
|
+
<h2>Info</h2>
|
|
58
|
+
<button id="btWMSInfo" disabled="true">WMS Info</button>
|
|
59
|
+
<h2>Layers</h2>
|
|
60
|
+
Project Layers: <select id="projectlayers"></select> - <small>click on "Load Project Layers button</small> <button id="btToggleLayer">Add / Remove Layer</button><br><br>
|
|
61
|
+
Displayed Layers: <select id="layers"></select> -
|
|
62
|
+
<button id="btActiveLayer">Set Active Layer</button>
|
|
63
|
+
<button id="btGetActiveLayer">Get Active Layer</button>
|
|
64
|
+
<span id="currentActiveLayer"></span>
|
|
65
|
+
|
|
66
|
+
<h2>Geolocation</h2>
|
|
67
|
+
<button id="btGeolocalize">Geolocalize User</button>
|
|
68
|
+
<button id="btStopGeolocalize">Cancel Geolocalize</button>
|
|
69
|
+
|
|
70
|
+
<h2>Highlight</h2>
|
|
71
|
+
<button id="btHighlight">Highlight geom</button>
|
|
72
|
+
Geom: <input type="text" name="geom" id="geom" size="25" value="">
|
|
73
|
+
<br>
|
|
74
|
+
Highlight to zoom level: <input type="text" name="zoomLevel" id="zoomLevel" size="5" value=""> or Zoom to geometry: <input type="checkbox" name="zoomToHighlightCheck" id="zoomToHighlightCheck" size="5" value="">
|
|
75
|
+
<h2>GeoJSON</h2>
|
|
76
|
+
|
|
77
|
+
<input type="file" id="geojsonfile" name="geojsonfile" accept="application/json"><small> Select geoJSON file</small><br><br>
|
|
78
|
+
<small>Or paste geoJSON content</small><br><br>
|
|
79
|
+
<textarea name="geojsondata" id="geojsondata" rows="10" cols="80" placeholder=""></textarea> <br><br>
|
|
80
|
+
<button id="btAddGeoJSON">Add GeoJSON </button><br><br>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<!--<script src="https://unpkg.com/@vidro/map-handler@1.0.7/dist/map-handler.js"></script>-->
|
|
84
|
+
<script src="../../dist/map-handler.js"></script>
|
|
85
|
+
<script src="../full/tester.js"></script>
|
|
86
|
+
<script src="./index.js"></script>
|
|
87
|
+
</body>
|
|
88
|
+
</html>
|
package/examples/full/apidemo.js
CHANGED
|
@@ -19,7 +19,7 @@ var btLoadMap = document.querySelector("#btLoadMap");
|
|
|
19
19
|
var btLoadProjectLayers = document.querySelector("#btLoadProjectLayers");
|
|
20
20
|
var projectlayers = document.getElementById("projectlayers");
|
|
21
21
|
var userData = document.querySelector("#userData");
|
|
22
|
-
|
|
22
|
+
var btAddGeoJSONFromGiswater = document.querySelector("#btAddGeoJSONFromGiswater");
|
|
23
23
|
|
|
24
24
|
var btLogin = document.querySelector("#btLogin");
|
|
25
25
|
|
|
@@ -106,10 +106,12 @@ function checkToken() {
|
|
|
106
106
|
//build XMLHttpRequest for checking token
|
|
107
107
|
var oReq = new XMLHttpRequest();
|
|
108
108
|
oReq.addEventListener("load", tokenListener);
|
|
109
|
-
oReq.open("GET", `${apiUrl}token
|
|
109
|
+
oReq.open("GET", `${apiUrl}token/`, true);
|
|
110
110
|
oReq.setRequestHeader("Content-type", "application/json");
|
|
111
|
+
oReq.setRequestHeader('Authorization',`Bearer ${usertoken.value}`);
|
|
112
|
+
|
|
111
113
|
oReq.send();
|
|
112
|
-
console.log("
|
|
114
|
+
console.log("Check token", `${apiUrl}token/`);
|
|
113
115
|
} else {
|
|
114
116
|
//show login form in case usertoken input is empty
|
|
115
117
|
loginContainer.classList.remove("hide");
|
|
@@ -170,7 +172,6 @@ function selectProject(id) {
|
|
|
170
172
|
|
|
171
173
|
btLoadMap.addEventListener("click", function (evt) {
|
|
172
174
|
apiUrl = document.querySelector("#apiurl").value;
|
|
173
|
-
var debug = parseInt(document.getElementById("debug").value);
|
|
174
175
|
//Build XMLHttpRequest for map
|
|
175
176
|
var selectedProjectId =
|
|
176
177
|
projects_select.options[projects_select.selectedIndex].value;
|
|
@@ -182,9 +183,7 @@ btLoadMap.addEventListener("click", function (evt) {
|
|
|
182
183
|
if (zoom) {
|
|
183
184
|
uri += `&zoom=${zoom}`;
|
|
184
185
|
}
|
|
185
|
-
|
|
186
|
-
uri += `&debug=${debug}`;
|
|
187
|
-
}
|
|
186
|
+
|
|
188
187
|
var logo = document.querySelector("#logo").value;
|
|
189
188
|
if (logo) {
|
|
190
189
|
uri += `&logo=${logo}`;
|
|
@@ -235,7 +234,9 @@ function mapListener() {
|
|
|
235
234
|
var res = JSON.parse(this.responseText);
|
|
236
235
|
errorContainer.classList.add("hide");
|
|
237
236
|
mapContainer.classList.remove("hide");
|
|
238
|
-
|
|
237
|
+
var src = `${res.message.iframe}?sessionToken=${res.message.sessionToken}`;
|
|
238
|
+
iframe.src = src;
|
|
239
|
+
console.log("iframe src", src);
|
|
239
240
|
sessionToken.innerHTML = res.message.sessionToken;
|
|
240
241
|
localStorage.setItem("iframe", iframe.src);
|
|
241
242
|
localStorage.setItem("sessionToken", res.message.sessionToken);
|
|
@@ -255,12 +256,12 @@ function mapListener() {
|
|
|
255
256
|
|
|
256
257
|
btLoadProjectLayers.addEventListener("click", function (evt) {
|
|
257
258
|
apiUrl = document.querySelector("#apiurl").value;
|
|
258
|
-
|
|
259
|
-
//Build XMLHttpRequest for project
|
|
259
|
+
|
|
260
|
+
//Build XMLHttpRequest for project layers
|
|
260
261
|
var selectedProjectId =
|
|
261
262
|
projects_select.options[projects_select.selectedIndex].value;
|
|
262
263
|
|
|
263
|
-
var uri = `${apiUrl}layers/${selectedProjectId}
|
|
264
|
+
var uri = `${apiUrl}layers/${selectedProjectId}`;
|
|
264
265
|
|
|
265
266
|
|
|
266
267
|
var oReq = new XMLHttpRequest();
|
|
@@ -271,6 +272,7 @@ btLoadProjectLayers.addEventListener("click", function (evt) {
|
|
|
271
272
|
oReq.send();
|
|
272
273
|
console.log("Attempt to load project layers", uri);
|
|
273
274
|
});
|
|
275
|
+
|
|
274
276
|
function layersListener() {
|
|
275
277
|
if (this.status === 200) {
|
|
276
278
|
console.log("layersListener response", this.responseText);
|
|
@@ -302,3 +304,44 @@ function fillLayersSelect(options){
|
|
|
302
304
|
//empty previous options
|
|
303
305
|
|
|
304
306
|
}
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
if(btAddGeoJSONFromGiswater){
|
|
310
|
+
btAddGeoJSONFromGiswater.addEventListener("click", function(){
|
|
311
|
+
let lay = document.getElementById('currentActiveLayerForGeoJSON').innerHTML.trim();
|
|
312
|
+
console.log(`Requesting Giswater GeoJSON for layer ${lay}`)
|
|
313
|
+
if(lay && lay!==''){
|
|
314
|
+
apiUrl = document.querySelector("#apiurl").value;
|
|
315
|
+
//Build XMLHttpRequest
|
|
316
|
+
var selectedProjectId =
|
|
317
|
+
projects_select.options[projects_select.selectedIndex].value;
|
|
318
|
+
var uri = `${apiUrl}giswater/geojson/${selectedProjectId}/${lay}`;
|
|
319
|
+
var oReq = new XMLHttpRequest();
|
|
320
|
+
oReq.addEventListener("load", GeoJSONListener);
|
|
321
|
+
oReq.open("GET", uri, true);
|
|
322
|
+
oReq.setRequestHeader('Authorization',`Bearer ${usertoken.value}`);
|
|
323
|
+
oReq.setRequestHeader("Content-type", "application/json");
|
|
324
|
+
oReq.send();
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function GeoJSONListener(){
|
|
330
|
+
if (this.status === 200) {
|
|
331
|
+
try{
|
|
332
|
+
var res = JSON.parse(this.responseText);
|
|
333
|
+
console.log("GeoJSONListener response", res.message);
|
|
334
|
+
if(document.getElementById('geojsondata')){
|
|
335
|
+
document.getElementById('geojsondata').value = JSON.stringify(res.message);
|
|
336
|
+
var btAddGeoJSON = document.querySelector("#btAddGeoJSON");
|
|
337
|
+
if(btAddGeoJSON){
|
|
338
|
+
btAddGeoJSON.click();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}catch(e){
|
|
342
|
+
console.error("Invalid API response")
|
|
343
|
+
}
|
|
344
|
+
} else {
|
|
345
|
+
console.error(this.status);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
170e6711fb6bc66563082bfc6237c548
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
129,130,131,132,126,128,117,162
|
package/examples/full/index.php
CHANGED
|
@@ -55,8 +55,6 @@
|
|
|
55
55
|
<div>
|
|
56
56
|
Use Giswater tiled: <input type="checkbox" name="use_giswater_tiled" id="use_giswater_tiled" size="5" value=""> <small>If tiled background available, load it with map render</small>
|
|
57
57
|
</div>
|
|
58
|
-
|
|
59
|
-
|
|
60
58
|
<div>
|
|
61
59
|
Override Capabitilites extent: <input type="text" name="extent" id="extent" size="55" value="" placeholder="397663,4615771,406392,4623596"> <small>Override project extent</small>
|
|
62
60
|
</div>
|
|
@@ -70,9 +68,10 @@
|
|
|
70
68
|
</div>
|
|
71
69
|
<div>
|
|
72
70
|
Debug
|
|
71
|
+
<button id="btDebug">Debug</button>
|
|
73
72
|
<select id="debug">
|
|
74
|
-
<option id="1"
|
|
75
|
-
<option id="0"
|
|
73
|
+
<option id="1" selected value=1>Show logs</option>
|
|
74
|
+
<option id="0" value=0>Hide logs</option>
|
|
76
75
|
</select> <small>Show/hide component logs</small>
|
|
77
76
|
</div>
|
|
78
77
|
<hr>
|
|
@@ -91,10 +90,38 @@
|
|
|
91
90
|
<hr />
|
|
92
91
|
<pre id="Result_container"></pre>
|
|
93
92
|
<hr/>
|
|
93
|
+
<h2>Layers</h2>
|
|
94
|
+
Project Layers: <select id="projectlayers"></select> - <small>click on "Load Project Layers button</small> <button id="btToggleLayer">Add / Remove Layer</button><br><br>
|
|
95
|
+
Displayed Layers: <select id="layers"></select> -
|
|
96
|
+
<button id="btActiveLayer">Set Active Layer</button>
|
|
97
|
+
<button id="btGetActiveLayer">Get Active Layer</button>
|
|
98
|
+
<span id="currentActiveLayer"></span>
|
|
99
|
+
<button id="btReloadDisplayedLayers">Reload displayed layers</button>
|
|
100
|
+
<br><br>
|
|
101
|
+
Override layer properties (gutter, single/multi tile, transparent)
|
|
102
|
+
<input type="checkbox" name="overrideLayerProperties" id="overrideLayerProperties" value="">
|
|
103
|
+
<div id="containerOverride" style="display: none;">____________________________________________________<br><br>
|
|
104
|
+
Gutter: <input type="text" name="gutter" id="gutter" size="5" value="">
|
|
105
|
+
<br><br>
|
|
106
|
+
Transparent layer:
|
|
107
|
+
<input type="checkbox" name="toggleTransparentLayer" id="toggleTransparentLayer" checked value=""><br><br>
|
|
108
|
+
SingleTile layer:
|
|
109
|
+
<input type="checkbox" name="toggleSingleTile" id="toggleSingleTile" checked value=""><br>
|
|
110
|
+
____________________________________________________
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<h4>Tiled layer</h4>
|
|
114
|
+
<button id="btToggleGiswaterTiled" disabled="true">Show/hide tiled Giswater tiled background</button>
|
|
115
|
+
<input type="checkbox" name="toggleGiswaterTiledCheck" id="toggleGiswaterTiledCheck" size="5" value=""><br><br>
|
|
116
|
+
<small>only for giswater projects with tiled enabled</small>
|
|
117
|
+
</div>
|
|
94
118
|
<h2>Zoom</h2>
|
|
95
119
|
<button id="btZoomIn">Zoom In</button>
|
|
96
120
|
<button id="btZoomOut">Zoom Out</button>
|
|
97
121
|
<button id="btZoomToExtent">Zoom to extent</button>
|
|
122
|
+
<br><br>
|
|
123
|
+
<button id="btZoomToCoordinates">Zoom to coordinates</button>
|
|
124
|
+
ZoomToCoordinates level: <input type="text" name="zoomLevelToCoordinates" id="zoomLevelToCoordinates" size="5" value="4">
|
|
98
125
|
<h2>Add geometry</h2>
|
|
99
126
|
<button id="btAddPoint">Add point</button>
|
|
100
127
|
<button id="btAddPolygon">Add polygon</button>
|
|
@@ -103,18 +130,7 @@
|
|
|
103
130
|
<h2>Info</h2>
|
|
104
131
|
<button id="btWMSInfo" disabled="true">WMS Info</button>
|
|
105
132
|
<button id="btGiswaterInfo">Giswater Info</button>
|
|
106
|
-
|
|
107
|
-
Project Layers: <select id="projectlayers"></select> - <small>click on "Load Project Layers button</small> <button id="btToggleLayer">Add / Remove Layer</button><br><br>
|
|
108
|
-
Displayed Layers: <select id="layers"></select> -
|
|
109
|
-
<button id="btActiveLayer">Set Active Layer</button>
|
|
110
|
-
<button id="btGetActiveLayer">Get Active Layer</button>
|
|
111
|
-
<span id="currentActiveLayer"></span>
|
|
112
|
-
<button id="btReloadDisplayedLayers">Reload displayed layers</button>
|
|
113
|
-
<h4>Tiled layer</h4>
|
|
114
|
-
<button id="btToggleGiswaterTiled" disabled="true">Show/hide tiled Giswater tiled background</button>
|
|
115
|
-
<input type="checkbox" name="toggleGiswaterTiledCheck" id="toggleGiswaterTiledCheck" size="5" value=""><br><br>
|
|
116
|
-
<small>only for giswater projects with tiled enabled</small>
|
|
117
|
-
</div>
|
|
133
|
+
|
|
118
134
|
<h2>Geolocation</h2>
|
|
119
135
|
<button id="btGeolocalize">Geolocalize User</button>
|
|
120
136
|
<button id="btStopGeolocalize">Cancel Geolocalize</button>
|
|
@@ -129,16 +145,19 @@
|
|
|
129
145
|
<textarea name="giswaterFilters" id="giswaterFilters" rows="10" cols="20">{"expl_id":[1,2,3]}</textarea>
|
|
130
146
|
<h2>GeoJSON</h2>
|
|
131
147
|
<input type="file" id="geojsonfile" name="geojsonfile" accept="application/json"><small> Select geoJSON file</small><br><br>
|
|
148
|
+
<small>Load a geojson from a Giswater layer<b><span id="currentActiveLayerForGeoJSON"></span></b></span></small> <button id="btAddGeoJSONFromGiswater" disabled>Add GeoJSON from Giswater Layer </button>
|
|
149
|
+
<input type="hidden" name="geojsondata" id="geojsondata"/>
|
|
150
|
+
<br><br>
|
|
132
151
|
<b>Options</b><br><br>
|
|
133
152
|
Stroke color: <input type="text" name="strokecolor" id="strokecolor" size="10" value="#994d4d" placeholder="#000000"> <small>Override stroke color, desfault #ff0000</small><br>
|
|
134
153
|
Fill color: <input type="text" name="fillcolor" id="fillcolor" size="10" value="#4d995c" placeholder="#000000"> <small>Override fill color, desfault #ff0000</small><br><br>
|
|
135
154
|
<button id="btAddGeoJSON">Add GeoJSON Layer</button> <button id="btClearGeoJSON">Clear GeoJSON Layers</button><br><br>
|
|
136
155
|
<input type="text" name="hitTolerance" id="hitTolerance" size="5" value="" placeholder="5"> <small>Override hit tolerance</small><br><br>
|
|
156
|
+
|
|
137
157
|
Selected GeoJSON Layer: <select id="geojsonlayers"></select> - <button id="btGeoJSONInfo" disabled="true">GeoJSON Info</button> <button id="btRemoveGeoJSONLayer" disabled="true">Remove GeoJSON Layer</button><br><br>
|
|
138
158
|
|
|
139
159
|
|
|
140
|
-
|
|
141
|
-
<script src="../../dist/map-handler.js"></script>
|
|
160
|
+
<script src="https://unpkg.com/@vidro/map-handler@1.0.8/dist/map-handler.js"></script>
|
|
142
161
|
<script src="./tester.js"></script>
|
|
143
162
|
<script src="./apidemo.js"></script>
|
|
144
163
|
</body>
|