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

@mappable-world/mappable-web-mercator-projection

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mappable-world/mappable-web-mercator-projection - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

1

dist/esm/web-mercator.js

@@ -41,2 +41,3 @@ import { cycleRestrict, restrict, DEG_TO_RAD, RAD_TO_DEG } from './utils';

this._maxLatitudeRad = Math.atan(Math.sinh(Math.PI));
this.type = 'EPSG:3857';
}

@@ -43,0 +44,0 @@ toWorldCoordinates(coords) {

2

dist/index.js

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

(()=>{"use strict";var t={341:function(t,e,r){var o=this&&this.__createBinding||(Object.create?function(t,e,r,o){void 0===o&&(o=r);var a=Object.getOwnPropertyDescriptor(e,r);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,o,a)}:function(t,e,r,o){void 0===o&&(o=r),t[o]=e[r]}),a=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||o(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),a(r(95),e)},147:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.restrict=e.cycleRestrict=e.RAD_TO_DEG=e.DEG_TO_RAD=void 0,e.DEG_TO_RAD=Math.PI/180,e.RAD_TO_DEG=180/Math.PI,e.cycleRestrict=function(t,e,r){return t-Math.floor((t-e)/(r-e))*(r-e)},e.restrict=function(t,e,r){return Math.max(Math.min(t,r),e)}},95:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WebMercator=void 0;const o=r(147);e.WebMercator=class{constructor(){this._maxLatitudeRad=Math.atan(Math.sinh(Math.PI))}toWorldCoordinates(t){return{x:this._longitudeToWorldX(t[0]),y:this._latitudeToWorldY(t[1])}}fromWorldCoordinates(t){return[this._worldXToLongitude(t.x),this._worldYToLatitude(t.y)]}_worldXToLongitude(t){return(0,o.cycleRestrict)(t*Math.PI*o.RAD_TO_DEG,-180,180)}_longitudeToWorldX(t){return(0,o.cycleRestrict)(t*o.DEG_TO_RAD/Math.PI,-1,1)}_latitudeToWorldY(t){const e=(0,o.restrict)(t*o.DEG_TO_RAD,-this._maxLatitudeRad,this._maxLatitudeRad),r=Math.tan(Math.PI/4+e/2);return(0,o.restrict)(Math.log(r)/Math.PI,-1,1)}_worldYToLatitude(t){const e=-t*Math.PI,r=Math.PI/2-2*Math.atan(Math.exp(e));return(0,o.restrict)(r*o.RAD_TO_DEG,-90,90)}}}},e={},r=function r(o){var a=e[o];if(void 0!==a)return a.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,r),i.exports}(341);self["@mappable-world/mappable-web-mercator-projection"]=r})();
(()=>{"use strict";var t={341:function(t,e,r){var o=this&&this.__createBinding||(Object.create?function(t,e,r,o){void 0===o&&(o=r);var a=Object.getOwnPropertyDescriptor(e,r);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,o,a)}:function(t,e,r,o){void 0===o&&(o=r),t[o]=e[r]}),a=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||o(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),a(r(95),e)},147:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.restrict=e.cycleRestrict=e.RAD_TO_DEG=e.DEG_TO_RAD=void 0,e.DEG_TO_RAD=Math.PI/180,e.RAD_TO_DEG=180/Math.PI,e.cycleRestrict=function(t,e,r){return t-Math.floor((t-e)/(r-e))*(r-e)},e.restrict=function(t,e,r){return Math.max(Math.min(t,r),e)}},95:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WebMercator=void 0;const o=r(147);e.WebMercator=class{constructor(){this._maxLatitudeRad=Math.atan(Math.sinh(Math.PI)),this.type="EPSG:3857"}toWorldCoordinates(t){return{x:this._longitudeToWorldX(t[0]),y:this._latitudeToWorldY(t[1])}}fromWorldCoordinates(t){return[this._worldXToLongitude(t.x),this._worldYToLatitude(t.y)]}_worldXToLongitude(t){return(0,o.cycleRestrict)(t*Math.PI*o.RAD_TO_DEG,-180,180)}_longitudeToWorldX(t){return(0,o.cycleRestrict)(t*o.DEG_TO_RAD/Math.PI,-1,1)}_latitudeToWorldY(t){const e=(0,o.restrict)(t*o.DEG_TO_RAD,-this._maxLatitudeRad,this._maxLatitudeRad),r=Math.tan(Math.PI/4+e/2);return(0,o.restrict)(Math.log(r)/Math.PI,-1,1)}_worldYToLatitude(t){const e=-t*Math.PI,r=Math.PI/2-2*Math.atan(Math.exp(e));return(0,o.restrict)(r*o.RAD_TO_DEG,-90,90)}}}},e={},r=function r(o){var a=e[o];if(void 0!==a)return a.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,r),i.exports}(341);self["@mappable-world/mappable-web-mercator-projection"]=r})();

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@mappable-world/mappable-web-mercator-projection"]=e():t["@mappable-world/mappable-web-mercator-projection"]=e()}(self,(()=>(()=>{"use strict";var t={341:function(t,e,r){var o=this&&this.__createBinding||(Object.create?function(t,e,r,o){void 0===o&&(o=r);var a=Object.getOwnPropertyDescriptor(e,r);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,o,a)}:function(t,e,r,o){void 0===o&&(o=r),t[o]=e[r]}),a=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||o(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),a(r(95),e)},147:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.restrict=e.cycleRestrict=e.RAD_TO_DEG=e.DEG_TO_RAD=void 0,e.DEG_TO_RAD=Math.PI/180,e.RAD_TO_DEG=180/Math.PI,e.cycleRestrict=function(t,e,r){return t-Math.floor((t-e)/(r-e))*(r-e)},e.restrict=function(t,e,r){return Math.max(Math.min(t,r),e)}},95:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WebMercator=void 0;const o=r(147);e.WebMercator=class{constructor(){this._maxLatitudeRad=Math.atan(Math.sinh(Math.PI))}toWorldCoordinates(t){return{x:this._longitudeToWorldX(t[0]),y:this._latitudeToWorldY(t[1])}}fromWorldCoordinates(t){return[this._worldXToLongitude(t.x),this._worldYToLatitude(t.y)]}_worldXToLongitude(t){return(0,o.cycleRestrict)(t*Math.PI*o.RAD_TO_DEG,-180,180)}_longitudeToWorldX(t){return(0,o.cycleRestrict)(t*o.DEG_TO_RAD/Math.PI,-1,1)}_latitudeToWorldY(t){const e=(0,o.restrict)(t*o.DEG_TO_RAD,-this._maxLatitudeRad,this._maxLatitudeRad),r=Math.tan(Math.PI/4+e/2);return(0,o.restrict)(Math.log(r)/Math.PI,-1,1)}_worldYToLatitude(t){const e=-t*Math.PI,r=Math.PI/2-2*Math.atan(Math.exp(e));return(0,o.restrict)(r*o.RAD_TO_DEG,-90,90)}}}},e={};return function r(o){var a=e[o];if(void 0!==a)return a.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,r),i.exports}(341)})()));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@mappable-world/mappable-web-mercator-projection"]=e():t["@mappable-world/mappable-web-mercator-projection"]=e()}(self,(()=>(()=>{"use strict";var t={341:function(t,e,r){var o=this&&this.__createBinding||(Object.create?function(t,e,r,o){void 0===o&&(o=r);var a=Object.getOwnPropertyDescriptor(e,r);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,o,a)}:function(t,e,r,o){void 0===o&&(o=r),t[o]=e[r]}),a=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||o(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),a(r(95),e)},147:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.restrict=e.cycleRestrict=e.RAD_TO_DEG=e.DEG_TO_RAD=void 0,e.DEG_TO_RAD=Math.PI/180,e.RAD_TO_DEG=180/Math.PI,e.cycleRestrict=function(t,e,r){return t-Math.floor((t-e)/(r-e))*(r-e)},e.restrict=function(t,e,r){return Math.max(Math.min(t,r),e)}},95:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WebMercator=void 0;const o=r(147);e.WebMercator=class{constructor(){this._maxLatitudeRad=Math.atan(Math.sinh(Math.PI)),this.type="EPSG:3857"}toWorldCoordinates(t){return{x:this._longitudeToWorldX(t[0]),y:this._latitudeToWorldY(t[1])}}fromWorldCoordinates(t){return[this._worldXToLongitude(t.x),this._worldYToLatitude(t.y)]}_worldXToLongitude(t){return(0,o.cycleRestrict)(t*Math.PI*o.RAD_TO_DEG,-180,180)}_longitudeToWorldX(t){return(0,o.cycleRestrict)(t*o.DEG_TO_RAD/Math.PI,-1,1)}_latitudeToWorldY(t){const e=(0,o.restrict)(t*o.DEG_TO_RAD,-this._maxLatitudeRad,this._maxLatitudeRad),r=Math.tan(Math.PI/4+e/2);return(0,o.restrict)(Math.log(r)/Math.PI,-1,1)}_worldYToLatitude(t){const e=-t*Math.PI,r=Math.PI/2-2*Math.atan(Math.exp(e));return(0,o.restrict)(r*o.RAD_TO_DEG,-90,90)}}}},e={};return function r(o){var a=e[o];if(void 0!==a)return a.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,r),i.exports}(341)})()));

@@ -40,3 +40,3 @@ import type { Projection, LngLat, WorldCoordinates } from '@mappable-world/mappable-types';

private _maxLatitudeRad;
type: 'EPSG:3857';
type: string;
toWorldCoordinates(coords: LngLat): WorldCoordinates;

@@ -43,0 +43,0 @@ fromWorldCoordinates(world: WorldCoordinates): LngLat;

{
"version": "0.0.1",
"version": "0.0.2",
"name": "@mappable-world/mappable-web-mercator-projection",

@@ -4,0 +4,0 @@ "description": "Mappable Maps JS API 3.0 example @mappable-world/mappable-web-mercator-projection",

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