@nextgis/ol-map-adapter
Advanced tools
Comparing version 0.8.3 to 0.8.4
@@ -1,2 +0,2 @@ | ||
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o(require("ol/proj"),require("ol/layer/Tile"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Stroke"),require("ol/Map"),require("ol/View"),require("ol/control/Zoom"),require("ol/geom/Polygon"),require("ol/control/Attribution"),require("ol/format/WKT"),require("ol/source/ImageWMS"),require("ol/layer/Image"),require("events"),require("ol/source/OSM"),require("ol/geom/Point"),require("ol/Feature"),require("ol/layer"),require("ol/source/XYZ"),require("ol/format/GeoJSON"),require("ol/layer/Vector"),require("ol/style/Circle"),require("ol/style/Style"),require("ol/style/Icon"),require("ol/format/GeoJson"),require("ol/extent")):"function"==typeof define&&define.amd?define(["ol/proj","ol/layer/Tile","ol/source/Vector","ol/style/Fill","ol/style/Stroke","ol/Map","ol/View","ol/control/Zoom","ol/geom/Polygon","ol/control/Attribution","ol/format/WKT","ol/source/ImageWMS","ol/layer/Image","events","ol/source/OSM","ol/geom/Point","ol/Feature","ol/layer","ol/source/XYZ","ol/format/GeoJSON","ol/layer/Vector","ol/style/Circle","ol/style/Style","ol/style/Icon","ol/format/GeoJson","ol/extent"],o):"object"==typeof exports?exports.OlMapAdapter=o(require("ol/proj"),require("ol/layer/Tile"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Stroke"),require("ol/Map"),require("ol/View"),require("ol/control/Zoom"),require("ol/geom/Polygon"),require("ol/control/Attribution"),require("ol/format/WKT"),require("ol/source/ImageWMS"),require("ol/layer/Image"),require("events"),require("ol/source/OSM"),require("ol/geom/Point"),require("ol/Feature"),require("ol/layer"),require("ol/source/XYZ"),require("ol/format/GeoJSON"),require("ol/layer/Vector"),require("ol/style/Circle"),require("ol/style/Style"),require("ol/style/Icon"),require("ol/format/GeoJson"),require("ol/extent")):e.OlMapAdapter=o(e["ol/proj"],e["ol/layer/Tile"],e["ol/source/Vector"],e["ol/style/Fill"],e["ol/style/Stroke"],e["ol/Map"],e["ol/View"],e["ol/control/Zoom"],e["ol/geom/Polygon"],e["ol/control/Attribution"],e["ol/format/WKT"],e["ol/source/ImageWMS"],e["ol/layer/Image"],e.events,e["ol/source/OSM"],e["ol/geom/Point"],e["ol/Feature"],e["ol/layer"],e["ol/source/XYZ"],e["ol/format/GeoJSON"],e["ol/layer/Vector"],e["ol/style/Circle"],e["ol/style/Style"],e["ol/style/Icon"],e["ol/format/GeoJson"],e["ol/extent"])}("undefined"!=typeof self?self:this,function(e,o,t,r,n,i,l,a,u,c,s,p,f,y,m,d,g,h,x,q,v,w,P,O,S,j){return function(e){var o={};function t(r){if(o[r])return o[r].exports;var n=o[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=e,t.c=o,t.d=function(e,o,r){t.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,o){if(1&o&&(e=t(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var n in e)t.d(r,n,function(o){return e[o]}.bind(null,n));return r},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},t.p="",t(t.s=26)}([function(o,t){o.exports=e},function(e,t){e.exports=o},function(e,o){e.exports=t},function(e,o){e.exports=r},function(e,o){e.exports=n},function(e,o){e.exports=i},function(e,o){e.exports=l},function(e,o){e.exports=a},function(e,o){e.exports=u},function(e,o){e.exports=c},function(e,o){e.exports=s},function(e,o){e.exports=p},function(e,o){e.exports=f},function(e,o){e.exports=y},function(e,o){e.exports=m},function(e,o){e.exports=d},function(e,o){e.exports=g},function(e,o){e.exports=h},function(e,o){e.exports=x},function(e,o){e.exports=q},function(e,o){e.exports=v},function(e,o){e.exports=w},function(e,o){e.exports=P},function(e,o){e.exports=O},function(e,o){e.exports=S},function(e,o){e.exports=j},function(e,o,t){"use strict";t.r(o);var r=t(5),n=t.n(r),i=t(6),l=t.n(i),a=t(7),u=t.n(a),c=t(8),s=t.n(c),p=t(9),f=t.n(p),y=t(10),m=t.n(y),d=t(11),g=t.n(d),h=t(12),x=t.n(h),q=1,v=function(){function e(){}return e.prototype.addLayer=function(e){this.name=e.id||"image-"+q++;var o={url:e.url,params:{resource:e.resourceId||e.id},ratio:1};e.updateWmsParams&&(o.imageLoadFunction=function(o,t){var r=t.split("?")[0],n=function(e){for(var o,t,r=decodeURIComponent,n=e.split("&"),i={},l=0,a=n.length,u=void 0;l<a;++l)if((u=n[l]).length){var c=u.indexOf("=");c<0?(o=r(u),t=""):(o=r(u.slice(0,c)),t=r(u.slice(c+1))),"string"==typeof i[o]&&(i[o]=[i[o]]),Array.isArray(i[o])?i[o].push(t):i[o]=t}return i}(t.split("?")[1]),i=n.resource,l=n.BBOX,a=n.WIDTH,u=n.HEIGHT,c=function e(o,t){var r=[];var n;for(n in o)if(o.hasOwnProperty(n)){var i=t?t+"["+n+"]":n,l=o[n];r.push(null!==l&&"object"==typeof l?e(l,i):encodeURIComponent(i)+"="+encodeURIComponent(l))}return r.join("&")}(e.updateWmsParams({resource:i,bbox:l,width:a,height:u}));o.getImage().src=r+"?"+c});var t=new g.a(o),r=new x.a({source:t});return this.layer=r,r},e}();var w=t(13),P=t(14),O=t.n(P),S=t(1),j=t.n(S),b=function(){function e(){this.name="osm"}return e.prototype.addLayer=function(e){return new j.a({source:new O.a})},e}(),M=t(15),I=t.n(M),L=t(16),V=t.n(L),G=t(17),A=t(2),C=t.n(A),F=t(0),T=1,E=function(){function e(){}return e.prototype.addLayer=function(e){this.name=e.id||"marker-"+T++;var o=e.latLng,t=o.lat,r=o.lng,n=new V.a({geometry:new I.a(Object(F.fromLonLat)([r,t]))}),i=new C.a({features:[n]});return new G.Vector({source:i})},e}(),_=t(18),k=t.n(_),Z=1,W=function(){function e(){}return e.prototype.addLayer=function(e){return this.name=e.id||"tile-"+Z++,new j.a({source:new k.a({url:e.url})})},e}(),R=t(19),J=t.n(R),N=t(20),U=t.n(N),X=t(21),K=t.n(X),Y=t(3),z=t.n(Y),B=t(4),D=t.n(B),H=t(22),Q=t.n(H),$=t(23),ee=t.n($),oe=t(24),te=t.n(oe),re=function(){return(re=Object.assign||function(e){for(var o,t=1,r=arguments.length;t<r;t++)for(var n in o=arguments[t])Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);return e}).apply(this,arguments)},ne=1,ie=function(){function e(){}return e.prototype.addLayer=function(e){this.name=e.id||"geojson-"+ne++;var o=(new J.a).readFeatures(e.data,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}),t=new C.a({features:o});return new U.a({source:t,style:function(o){return function e(o,t){if("function"==typeof t){var r=new te.a,n=r.writeFeatureObject(o);return e(o,t(n))}var i=o.getGeometry().getType(),l={};if(!t.type){var a=ae[i];t.type="fill"===a||"line"===a?"path":"html"in t||"className"in t?"icon":a}if("path"===t.type)l.fill=new z.a(t),(t.stroke||-1!==["MultiLineString","LineString"].indexOf(i))&&(l.stroke=new D.a({width:t.weight,color:t.color}));else if("circle"===t.type)l.image=le(t);else if("icon"===t.type){var u=t.html;l.image=new ee.a({src:"data:image/svg+xml,"+escape(u),anchor:t.iconAnchor,imgSize:t.iconSize,anchorXUnits:"pixels",anchorYUnits:"pixels"})}return new Q.a(l)}(o,e.paint)}})},e}(),le=function(e){return new K.a(re({},e,{stroke:new D.a(e),fill:new z.a(e)}))},ae={Point:"circle",MultiPoint:"circle",LineString:"line",MultiLineString:"line",Polygon:"fill",MultiPolygon:"fill",Circle:"circle"};var ue=t(25),ce=function(){return(ce=Object.assign||function(e){for(var o,t=1,r=arguments.length;t<r;t++)for(var n in o=arguments[t])Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);return e}).apply(this,arguments)},se=function(){function e(){this.layerAdapters=e.layerAdapters,this.displayProjection="EPSG:3857",this.lonlatProjection="EPSG:4326",this.emitter=new w.EventEmitter,this.DPI=1e3/39.37/.28,this.IPM=39.37}return e.prototype.create=function(e){this.options=Object.assign({},e);var o=new l.a({center:e.center,zoom:e.zoom,projection:this.displayProjection}),t=ce({},{logo:!1,controls:[],view:o,layers:[]},e);this.map=new n.a(t),this.emitter.emit("create",{map:this.map}),this._olView=this.map.getView(),this._addMapListeners()},e.prototype.getContainer=function(){return document.getElementById(this.options.target)},e.prototype.onMapLoad=function(e){return new Promise(function(o){o(e&&e())})},e.prototype.setCenter=function(e){this._olView.setCenter(Object(F.fromLonLat)(e))},e.prototype.setZoom=function(e){this._olView.setZoom(e)},e.prototype.fit=function(e){var o=Object(F.transformExtent)(e,this.lonlatProjection,this.displayProjection);this._olView.fit(o)},e.prototype.setRotation=function(e){this._olView.setRotation(e)},e.prototype.removeLayer=function(e){this.map.removeLayer(e)},e.prototype.showLayer=function(e){this.map.addLayer(e)},e.prototype.hideLayer=function(e){this.map.removeLayer(e)},e.prototype.setLayerOpacity=function(e,o){},e.prototype.setLayerOrder=function(e,o,t){e.setZIndex(o)},e.prototype.getScaleForResolution=function(e,o){return parseFloat(e)*(o*this.IPM*this.DPI)},e.prototype.getResolutionForScale=function(e,o){return parseFloat(e)/(o*this.IPM*this.DPI)},e.prototype.addControl=function(o,t,r){var n;if("string"==typeof o){var i=e.controlAdapters[o];i&&(n=new i(r))}else n=o;if(n)return this.map.addControl(n),n},e.prototype.onMapClick=function(e){var o=Object(F.transform)(e.coordinate,this.displayProjection,this.lonlatProjection),t=o[0],r={lat:o[1],lng:t};this.emitter.emit("click",{latLng:r,pixel:{left:e.pixel[0],top:e.pixel[1]},source:e})},e.prototype.requestGeomString=function(e,o){void 0===o&&(o=5);var t=e.top,r=e.left,n=this.map,i=Object(ue.boundingExtent)([n.getCoordinateFromPixel([r-o,t-o]),n.getCoordinateFromPixel([r+o,t+o])]);return(new m.a).writeGeometry(s.a.fromExtent(i))},e.prototype._addMapListeners=function(){var e=this;this.map.on("click",function(o){e.onMapClick(o)})},e.layerAdapters={IMAGE:v,TILE:W,OSM:b,MARKER:E,GEOJSON:ie},e.controlAdapters={ZOOM:u.a,ATTRIBUTION:f.a},e}();o.default=se}]).default}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ol/proj"),require("ol/source/OSM"),require("ol/layer/Tile"),require("ol/source/Vector"),require("ol/format/GeoJSON"),require("ol/style/Fill"),require("ol/style/Stroke"),require("ol/Map"),require("ol/View"),require("ol/control/Zoom"),require("ol/geom/Polygon"),require("ol/format/WKT"),require("ol/source/ImageWMS"),require("ol/layer/Image"),require("events"),require("ol/geom/Point"),require("ol/Feature"),require("ol/layer"),require("ol/source/XYZ"),require("ol/layer/Vector"),require("ol/style/Circle"),require("ol/style/Style"),require("ol/style/Icon"),require("ol/extent"),require("ol/control/Attribution")):"function"==typeof define&&define.amd?define(["ol/proj","ol/source/OSM","ol/layer/Tile","ol/source/Vector","ol/format/GeoJSON","ol/style/Fill","ol/style/Stroke","ol/Map","ol/View","ol/control/Zoom","ol/geom/Polygon","ol/format/WKT","ol/source/ImageWMS","ol/layer/Image","events","ol/geom/Point","ol/Feature","ol/layer","ol/source/XYZ","ol/layer/Vector","ol/style/Circle","ol/style/Style","ol/style/Icon","ol/extent","ol/control/Attribution"],t):"object"==typeof exports?exports.OlMapAdapter=t(require("ol/proj"),require("ol/source/OSM"),require("ol/layer/Tile"),require("ol/source/Vector"),require("ol/format/GeoJSON"),require("ol/style/Fill"),require("ol/style/Stroke"),require("ol/Map"),require("ol/View"),require("ol/control/Zoom"),require("ol/geom/Polygon"),require("ol/format/WKT"),require("ol/source/ImageWMS"),require("ol/layer/Image"),require("events"),require("ol/geom/Point"),require("ol/Feature"),require("ol/layer"),require("ol/source/XYZ"),require("ol/layer/Vector"),require("ol/style/Circle"),require("ol/style/Style"),require("ol/style/Icon"),require("ol/extent"),require("ol/control/Attribution")):e.OlMapAdapter=t(e["ol/proj"],e["ol/source/OSM"],e["ol/layer/Tile"],e["ol/source/Vector"],e["ol/format/GeoJSON"],e["ol/style/Fill"],e["ol/style/Stroke"],e["ol/Map"],e["ol/View"],e["ol/control/Zoom"],e["ol/geom/Polygon"],e["ol/format/WKT"],e["ol/source/ImageWMS"],e["ol/layer/Image"],e.events,e["ol/geom/Point"],e["ol/Feature"],e["ol/layer"],e["ol/source/XYZ"],e["ol/layer/Vector"],e["ol/style/Circle"],e["ol/style/Style"],e["ol/style/Icon"],e["ol/extent"],e["ol/control/Attribution"])}("undefined"!=typeof self?self:this,function(e,t,o,r,n,i,l,u,a,c,s,p,f,y,m,d,h,g,x,v,q,w,O,P,b){return function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=25)}([function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t){e.exports=o},function(e,t){e.exports=r},function(e,t){e.exports=n},function(e,t){e.exports=i},function(e,t){e.exports=l},function(e,t){e.exports=u},function(e,t){e.exports=a},function(e,t){e.exports=c},function(e,t){e.exports=s},function(e,t){e.exports=p},function(e,t){e.exports=f},function(e,t){e.exports=y},function(e,t){e.exports=m},function(e,t){e.exports=d},function(e,t){e.exports=h},function(e,t){e.exports=g},function(e,t){e.exports=x},function(e,t){e.exports=v},function(e,t){e.exports=q},function(e,t){e.exports=w},function(e,t){e.exports=O},function(e,t){e.exports=P},function(e,t){e.exports=b},function(e,t,o){"use strict";o.r(t);var r=o(7),n=o.n(r),i=o(8),l=o.n(i),u=o(9),a=o.n(u),c=o(10),s=o.n(c),p=o(11),f=o.n(p),y=o(12),m=o.n(y),d=o(13),h=o.n(d),g=1,x=function(){function e(){}return e.prototype.addLayer=function(e){this.name=e.id||"image-"+g++;var t={url:e.url,params:{resource:e.resourceId||e.id},ratio:1};e.updateWmsParams&&(t.imageLoadFunction=function(t,o){var r=o.split("?")[0],n=function(e){for(var t,o,r=decodeURIComponent,n=e.split("&"),i={},l=0,u=n.length,a=void 0;l<u;++l)if((a=n[l]).length){var c=a.indexOf("=");c<0?(t=r(a),o=""):(t=r(a.slice(0,c)),o=r(a.slice(c+1))),"string"==typeof i[t]&&(i[t]=[i[t]]),Array.isArray(i[t])?i[t].push(o):i[t]=o}return i}(o.split("?")[1]),i=n.resource,l=n.BBOX,u=n.WIDTH,a=n.HEIGHT,c=function e(t,o){var r=[];var n;for(n in t)if(t.hasOwnProperty(n)){var i=o?o+"["+n+"]":n,l=t[n];r.push(null!==l&&"object"==typeof l?e(l,i):encodeURIComponent(i)+"="+encodeURIComponent(l))}return r.join("&")}(e.updateWmsParams({resource:i,bbox:l,width:u,height:a}));t.getImage().src=r+"?"+c});var o=new m.a(t),r=new h.a({source:o});return this.layer=r,r},e}();var v=o(14),q=o(1),w=o.n(q),O=o(2),P=o.n(O),b=function(){function e(){this.name="osm"}return e.prototype.addLayer=function(e){var t=[q.ATTRIBUTION];return new P.a({source:new w.a({attributions:t})})},e}(),j=o(15),S=o.n(j),M=o(16),I=o.n(M),L=o(17),_=o(3),T=o.n(_),A=o(0),V=1,C=function(){function e(){}return e.prototype.addLayer=function(e){this.name=e.id||"marker-"+V++;var t=e.latLng,o=t.lat,r=t.lng,n=new I.a({geometry:new S.a(Object(A.fromLonLat)([r,o]))}),i=new T.a({features:[n]});return new L.Vector({source:i})},e}(),F=o(18),E=o.n(F),G=1,k=function(){function e(){}return e.prototype.addLayer=function(e){return this.name=e.id||"tile-"+G++,new P.a({source:new E.a({attributions:e.attribution?[e.attribution]:[],url:e.url})})},e}(),Z=o(4),R=o.n(Z),W=o(19),N=o.n(W),U=o(20),X=o.n(U),B=o(5),J=o.n(B),K=o(6),Y=o.n(K),z=o(21),D=o.n(z),H=o(22),Q=o.n(H),$=function(){return($=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},ee=1,te=function(){function e(){}return e.prototype.addLayer=function(e){this.name=e.id||"geojson-"+ee++;var t=(new R.a).readFeatures(e.data,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}),o=new T.a({features:t});return new N.a({source:o,style:function(t){return function e(t,o){if("function"==typeof o){var r=new R.a,n=r.writeFeatureObject(t);return e(t,o(n))}var i=t.getGeometry().getType(),l={};if(!o.type){var u=re[i];o.type="fill"===u||"line"===u?"path":"html"in o||"className"in o?"icon":u}if("path"===o.type)l.fill=new J.a(o),(o.stroke||-1!==["MultiLineString","LineString"].indexOf(i))&&(l.stroke=new Y.a({width:o.weight,color:o.color}));else if("circle"===o.type)l.image=oe(o);else if("icon"===o.type){var a=o.html;l.image=new Q.a({src:"data:image/svg+xml,"+escape(a),anchor:o.iconAnchor,imgSize:o.iconSize,anchorXUnits:"pixels",anchorYUnits:"pixels"})}return new D.a(l)}(t,e.paint)}})},e}(),oe=function(e){return new X.a($({},e,{stroke:new Y.a(e),fill:new J.a(e)}))},re={Point:"circle",MultiPoint:"circle",LineString:"line",MultiLineString:"line",Polygon:"fill",MultiPolygon:"fill",Circle:"circle"};var ne,ie=o(23),le=o(24),ue=(ne=function(e,t){return(ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)},function(e,t){function o(){this.constructor=e}ne(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),ae=function(){return(ae=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},ce={collapsible:!1},se=function(e){function t(t){return e.call(this,ae({},ce,t))||this}return ue(t,e),t}(o.n(le).a),pe=function(){return(pe=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},fe=function(){function e(){this.layerAdapters=e.layerAdapters,this.displayProjection="EPSG:3857",this.lonlatProjection="EPSG:4326",this.emitter=new v.EventEmitter,this.DPI=1e3/39.37/.28,this.IPM=39.37}return e.prototype.create=function(e){this.options=Object.assign({},e);var t=new l.a({center:e.center,zoom:e.zoom,projection:this.displayProjection}),o=pe({},{logo:!1,controls:[],view:t,layers:[]},e);this.map=new n.a(o),this.emitter.emit("create",{map:this.map}),this._olView=this.map.getView(),this._addMapListeners()},e.prototype.getContainer=function(){return document.getElementById(this.options.target)},e.prototype.onMapLoad=function(e){return new Promise(function(t){t(e&&e())})},e.prototype.setCenter=function(e){this._olView.setCenter(Object(A.fromLonLat)(e))},e.prototype.setZoom=function(e){this._olView.setZoom(e)},e.prototype.fit=function(e){var t=Object(A.transformExtent)(e,this.lonlatProjection,this.displayProjection);this._olView.fit(t)},e.prototype.setRotation=function(e){this._olView.setRotation(e)},e.prototype.removeLayer=function(e){this.map.removeLayer(e)},e.prototype.showLayer=function(e){this.map.addLayer(e)},e.prototype.hideLayer=function(e){this.map.removeLayer(e)},e.prototype.setLayerOpacity=function(e,t){},e.prototype.setLayerOrder=function(e,t,o){e.setZIndex(t)},e.prototype.getScaleForResolution=function(e,t){return parseFloat(e)*(t*this.IPM*this.DPI)},e.prototype.getResolutionForScale=function(e,t){return parseFloat(e)/(t*this.IPM*this.DPI)},e.prototype.addControl=function(t,o,r){var n;if("string"==typeof t){var i=e.controlAdapters[t];i&&(n=new i)}else n=t;if(n)return this.map.addControl(n),n},e.prototype.onMapClick=function(e){var t=Object(A.transform)(e.coordinate,this.displayProjection,this.lonlatProjection),o=t[0],r={lat:t[1],lng:o};this.emitter.emit("click",{latLng:r,pixel:{left:e.pixel[0],top:e.pixel[1]},source:e})},e.prototype.requestGeomString=function(e,t){void 0===t&&(t=5);var o=e.top,r=e.left,n=this.map,i=Object(ie.boundingExtent)([n.getCoordinateFromPixel([r-t,o-t]),n.getCoordinateFromPixel([r+t,o+t])]);return(new f.a).writeGeometry(s.a.fromExtent(i))},e.prototype._addMapListeners=function(){var e=this;this.map.on("click",function(t){e.onMapClick(t)})},e.layerAdapters={IMAGE:x,TILE:k,OSM:b,MARKER:C,GEOJSON:te},e.controlAdapters={ZOOM:a.a,ATTRIBUTION:se},e}();t.default=fe}]).default}); | ||
//# sourceMappingURL=ol-map-adapter.js.map |
@@ -5,3 +5,2 @@ /// <reference types="node" /> | ||
import Zoom from 'ol/control/Zoom'; | ||
import Attribution from 'ol/control/Attribution'; | ||
import { ImageAdapter } from './layer-adapters/ImageAdapter'; | ||
@@ -13,2 +12,3 @@ import { EventEmitter } from 'events'; | ||
import { GeoJsonAdapter } from './layer-adapters/GeoJsonAdapter'; | ||
import { Attribution } from './controls/Attribution'; | ||
export declare class OlMapAdapter implements MapAdapter { | ||
@@ -15,0 +15,0 @@ static layerAdapters: { |
{ | ||
"name": "@nextgis/ol-map-adapter", | ||
"version": "0.8.3", | ||
"version": "0.8.4", | ||
"description": "", | ||
@@ -49,3 +49,3 @@ "main": "lib/ol-map-adapter.js", | ||
"license": "GPL-3.0", | ||
"gitHead": "14f948b000e6b24325c26c0650d4232d8d817f76" | ||
"gitHead": "544043011351ab7750030faf21bfefd835401bca" | ||
} |
@@ -0,0 +0,0 @@ # OpenLayers map adapter |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89079
13
137