Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lmap

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lmap - npm Package Compare versions

Comparing version 0.1.12 to 0.1.13

map/ripple.js

2

map/map.js

@@ -1,1 +0,1 @@

"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=require("jquery"),i=require("./../leaflet"),n=require("./../core/utils"),o=i.Map.extend({options:{isRotateZ:!1,background:null,crs:i.CRS.EPSG3857,fadeAnimation:i.DomUtil.TRANSITION&&!i.Browser.android23,trackResize:!0,markerZoomAnimation:i.DomUtil.TRANSITION&&i.Browser.any3d,preferCanvas:!0,zoomSnap:.01,view3dOptions:{x:50,y:0,z:0}},initOverlay:function(){this.overlayNode=e('<div style="position:absolute;width:100%;height:100%;top:0;left:0;pointer-events:none;"></div>').appendTo(this._container)},initUIContainer:function(){return this.uiNode=e('<div style="position:absolute;width:100%;height:100%;top:0;left:0;pointer-events:none;z-index:1000;"></div>').appendTo(this._container)},getUIContainer:function(){var t=this.uiNode;return t||(t=this.uiNode=this.initUIContainer()),t},getOverlay:function(){return this.overlayNode},initialize:function(t,e){if(t=n.getContainer(t),!t)return console.log("map container错误");var o=t.getAttribute("id");o||(o="map-"+Math.floor(1e9*Math.random()),t.setAttribute("id",o)),e=i.setOptions(this,e),i.Map.prototype.initialize.call(this,o,e),this.initOverlay(),this.updateDragging(),this.updateBgColor(),this.initEvent()},getPixelBounds:function(){var t=this._getTopLeftPoint(),e=new i.Bounds(t,t.add(this.getSize())),n=this.offsetBoundX||0,o=this.offsetBoundY||0;return e.min.x=e.min.x-n,e.min.y=e.min.y-n,e.max.x=e.max.x+o,e.max.y=e.max.y+o,e},updateOptions:function(t){t&&(t=this.options=n.deepMerge(this.options,t),t.zoom&&this.setZoom(t.zoom),t.center&&this.panTo(t.center),this.updateDragging(),this.updateBgColor(),i.setOptions(this,this.options))},updateDragging:function(){var t=this.options.draggable;t===!1?this.dragging.disable():this.dragging.enable()},init3d:function(){if(!this.isInit3d){this.offsetBoundX=1e3,this.offsetBoundY=1e3;var t=this._container;e(t).css({overflow:"visible"}),this.addHooks3dLayer(),this.initEvents3d(),this.isInit3d=!0}},addHooks3dLayer:function(){this.on("move",this._update3dLayers,this)},removeHooks3dLayer:function(){this.off("move",this._update3dLayers,this)},_getTransformOrigin:function(t){var e=this._size,i=this._getMapPanePos();return-i.x+e.x/2+"px "+(-i.y+e.y/2+1*t)+"px"},_update3dLayer:function(t,i){var n=this._getTransformOrigin(i),o="rotateX("+this.options.view3dOptions.x+"deg)";t.css({transformOrigin:n,transform:o,zIndex:0}),e(".leaflet-marker-pane").show()},_update2dLayer:function(t,e){var i=this._getTransformOrigin(e),n="rotateX(0deg)";t.css({transformOrigin:i,transform:n+"translateZ(10px)",zIndex:0})},_update3dLayers:function(){this.init3d();var t=1200,i=this.panes=e(this._container).find(".leaflet-map-pane");i.css({webkitPerspective:t,perspective:t,perspectiveOrigin:this._getTransformOrigin(0)}),this._update3dLayer(i.find(".leaflet-objects-pane"),1),this._update3dLayer(i.find(".leaflet-tile-pane"),1)},_update2dLayers:function(){var t=this.panes=e(this._container).find(".leaflet-map-pane"),i=1200;t.css({webkitPerspective:i,perspective:i,perspectiveOrigin:this._getTransformOrigin(0)}),this._update2dLayer(t.find(".leaflet-objects-pane"),1),this._update2dLayer(t.find(".leaflet-tile-pane"),1)},view3d:function(t){var t=i.Util.extend(this.options.view3dOptions,t);this._update3dLayers()},view2d:function(){this._update2dLayers(),this.cancel3d(),this.hideMarkerPane(),this.disableRotate()},cancel3d:function(){this.offsetBoundX=0,this.offsetBoundY=0,this.removeHooks3dLayer()},hideMarkerPane:function(){e(".leaflet-marker-pane").hide(),e(".leaflet-marker-pane").css("transform","rotateZ(0deg)")},setDomStyle:function(i){i&&"object"===("undefined"==typeof i?"undefined":t(i))&&e(this._container).css(i)},updateBgColor:function(){var t=this.options.background;t&&this.setBgColor(t)},setBgColor:function(t){this.setDomStyle({"background-color":t})},detect:function(){this.on("moveend",function(){console.log(this.getCenter(),this.getZoom())})},disableRotate:function(){this.isRotateZ=!1,this.dragging.enable(),e(".leaflet-layer").attr("style","transform:rotateZ(0deg)"),e(".leaflet-marker-pane").css("transform","rotateZ(0deg)"),this.fire("rotate",{rotation:0})},enableRotate:function(){this.isRotateZ=!0,this.dragging.disable()},initEvent:function(){setTimeout(this.initEvent.bind(this),1e3),this.invalidateSize()},initEvents3d:function(){this.angle=0,this.xdrag=0;var t=this,i=!1,n=0,o=e("#map-container");o.on("mousedown",function(e){t.isRotateZ&&(n=e.pageX,i=!0,t.fire("rotatestart"))}).on("mousemove",function(o){if(t.isRotateZ&&i){t.xdrag=(n-o.pageX)/4;var a="rotateZ("+(t.angle+t.xdrag)%360+"deg)",s=t._getTransformOrigin(0),r={"-webkit-transform":a,transform:a,"transform-origin":s,"-webkit-transform-origin":s};e(".leaflet-layer").css(r),e(".leaflet-marker-pane").css(r),e(".leaflet-objects-pane").css("transform-origin",s),e(".leaflet-tile-pane").css("transform-origin",s),t.fire("rotate",{rotation:t.angle+t.xdrag})}}).on("mouseup",function(){t.isRotateZ&&(i=!1,t.fire("rotateend"),t.angle=t.angle+t.xdrag)})}}),a=i.dmap=i.dmap||{};a.Map=o,a.map=function(t,e){return new o(t,e)},module.exports=o;
"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=require("jquery"),i=require("./../leaflet"),n=require("./ripple"),o=require("./../core/utils"),a=i.Map.extend({options:{isRotateZ:!1,isDoubleClickRipple:!0,background:null,crs:i.CRS.EPSG3857,fadeAnimation:i.DomUtil.TRANSITION&&!i.Browser.android23,trackResize:!0,markerZoomAnimation:i.DomUtil.TRANSITION&&i.Browser.any3d,preferCanvas:!0,zoomSnap:.01,view3dOptions:{x:50,y:0,z:0}},initOverlay:function(){this.overlayNode=e('<div style="position:absolute;width:100%;height:100%;top:0;left:0;pointer-events:none;"></div>').appendTo(this._container)},initUIContainer:function(){return this.uiNode=e('<div style="position:absolute;width:100%;height:100%;top:0;left:0;pointer-events:none;z-index:1000;"></div>').appendTo(this._container)},getUIContainer:function(){var t=this.uiNode;return t||(t=this.uiNode=this.initUIContainer()),t},getOverlay:function(){return this.overlayNode},initialize:function(t,e){if(t=this.domContainer=o.getContainer(t),!t)return console.log("map container错误");var n=t.getAttribute("id");n||(n="map-"+Math.floor(1e9*Math.random()),t.setAttribute("id",n)),e=i.setOptions(this,e),i.Map.prototype.initialize.call(this,n,e),this.initOverlay(),this.updateDragging(),this.updateBgColor(),this.initEvent(),setTimeout(this.initRippe.bind(this))},initRippe:function(){var t=new n;t.addTo(this)},getPixelBounds:function(){var t=this._getTopLeftPoint(),e=new i.Bounds(t,t.add(this.getSize())),n=this.offsetBoundX||0,o=this.offsetBoundY||0;return e.min.x=e.min.x-n,e.min.y=e.min.y-n,e.max.x=e.max.x+o,e.max.y=e.max.y+o,e},updateOptions:function(t){t&&(t=this.options=o.deepMerge(this.options,t),t.zoom&&this.setZoom(t.zoom),t.center&&this.panTo(t.center),this.updateDragging(),this.updateBgColor(),i.setOptions(this,this.options))},updateDragging:function(){var t=this.options.draggable;t===!1?this.dragging.disable():this.dragging.enable()},init3d:function(){if(!this.isInit3d){this.offsetBoundX=1e3,this.offsetBoundY=1e3;var t=this._container;e(t).css({overflow:"visible"}),this.addHooks3dLayer(),this.initEvents3d(),this.isInit3d=!0}},addHooks3dLayer:function(){this.on("move",this._update3dLayers,this)},removeHooks3dLayer:function(){this.off("move",this._update3dLayers,this)},_getTransformOrigin:function(t){var e=this._size,i=this._getMapPanePos();return-i.x+e.x/2+"px "+(-i.y+e.y/2+1*t)+"px"},_update3dLayer:function(t,i){var n=this._getTransformOrigin(i),o="rotateX("+this.options.view3dOptions.x+"deg)";t.css({transformOrigin:n,transform:o,zIndex:0}),e(".leaflet-marker-pane").show()},_update2dLayer:function(t,e){var i=this._getTransformOrigin(e),n="rotateX(0deg)";t.css({transformOrigin:i,transform:n+"translateZ(10px)",zIndex:0})},_update3dLayers:function(){this.init3d();var t=1200,i=this.panes=e(this._container).find(".leaflet-map-pane");i.css({webkitPerspective:t,perspective:t,perspectiveOrigin:this._getTransformOrigin(0)}),this._update3dLayer(i.find(".leaflet-objects-pane"),1),this._update3dLayer(i.find(".leaflet-tile-pane"),1)},_update2dLayers:function(){var t=this.panes=e(this._container).find(".leaflet-map-pane"),i=1200;t.css({webkitPerspective:i,perspective:i,perspectiveOrigin:this._getTransformOrigin(0)}),this._update2dLayer(t.find(".leaflet-objects-pane"),1),this._update2dLayer(t.find(".leaflet-tile-pane"),1)},view3d:function(t){var t=i.Util.extend(this.options.view3dOptions,t);this._update3dLayers()},view2d:function(){this._update2dLayers(),this.cancel3d(),this.hideMarkerPane(),this.disableRotate()},cancel3d:function(){this.offsetBoundX=0,this.offsetBoundY=0,this.removeHooks3dLayer()},hideMarkerPane:function(){e(".leaflet-marker-pane").hide(),e(".leaflet-marker-pane").css("transform","rotateZ(0deg)")},setDomStyle:function(i){i&&"object"===("undefined"==typeof i?"undefined":t(i))&&e(this._container).css(i)},updateBgColor:function(){var t=this.options.background;t&&this.setBgColor(t)},setBgColor:function(t){this.setDomStyle({"background-color":t})},detect:function(){this.on("moveend",function(){console.log(this.getCenter(),this.getZoom())})},disableRotate:function(){this.isRotateZ=!1,this.dragging.enable(),e(".leaflet-layer").attr("style","transform:rotateZ(0deg)"),e(".leaflet-marker-pane").css("transform","rotateZ(0deg)"),this.fire("rotate",{rotation:0})},enableRotate:function(){this.isRotateZ=!0,this.dragging.disable()},initEvent:function(){setTimeout(this.initEvent.bind(this),1e3),this.invalidateSize()},initEvents3d:function(){this.angle=0,this.xdrag=0;var t=this,i=!1,n=0,o=e("#map-container");o.on("mousedown",function(e){t.isRotateZ&&(n=e.pageX,i=!0,t.fire("rotatestart"))}).on("mousemove",function(o){if(t.isRotateZ&&i){t.xdrag=(n-o.pageX)/4;var a="rotateZ("+(t.angle+t.xdrag)%360+"deg)",s=t._getTransformOrigin(0),r={"-webkit-transform":a,transform:a,"transform-origin":s,"-webkit-transform-origin":s};e(".leaflet-layer").css(r),e(".leaflet-marker-pane").css(r),e(".leaflet-objects-pane").css("transform-origin",s),e(".leaflet-tile-pane").css("transform-origin",s),t.fire("rotate",{rotation:t.angle+t.xdrag})}}).on("mouseup",function(){t.isRotateZ&&(i=!1,t.fire("rotateend"),t.angle=t.angle+t.xdrag)})}}),s=i.dmap=i.dmap||{};s.Map=a,s.map=function(t,e){return new a(t,e)},module.exports=a;

@@ -8,3 +8,3 @@ {

},
"version": "0.1.12",
"version": "0.1.13",
"scripts": {

@@ -11,0 +11,0 @@ "test": "mocha -r jscoverage test",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc