Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@yandex/ymaps3-web-mercator-projection
Advanced tools
Yandex Maps JS API 3.0 example @yandex/ymaps3-web-mercator-projection
Web Mercator projection package for Yandex JS API.
You can install this package via npm:
npm install --save @yandex/ymaps3-web-mercator-projection
To use Web Mercator projection, just import it:
import {WebMercator} from '@yandex/ymaps3-web-mercator-projection';
const projection = new WebMercator();
console.log(projection.toWorldCoordinates([-180, 90])) // {x: -1, y: 1}
console.log(projection.toWorldCoordinates([-180, 85.051])) // ~ {x: -1, y: 1}
console.log(projection.toWorldCoordinates([90, 0])) // ~ {x: 0.5, y: 0}
console.log(projection.toWorldCoordinates([0, -23.6])) // ~ {x: 0, y: -0.135}
console.log(projection.fromWorldCoordinates({x: -1, y: 1})) // ~ [-180, 85.051]
console.log(projection.fromWorldCoordinates({x: 0.5, y: 0})) // [90, 0]
console.log(projection.fromWorldCoordinates({x: 0, y: -0.135})) // ~ [0, -23.6]
You can use some CDN with ymaps3.import
JS API module loading handler on your page:
const {WebMercator} = await ymaps3.import('@yandex/ymaps3-web-mercator-projection');
NOTE:
By default ymaps3.import
can load self modules, scripts or style.
To make the code above work, you should add a loader:
// Add loader at the beginning of the loader queue
ymaps3.import.loaders.unshift(async (pkg) => {
// Process only this package
if (!pkg.includes('@yandex/ymaps3-web-mercator-projection')) return;
// Load script directly. You can use another CDN
await ymaps3.import.script(`https://unpkg.com/${pkg}/dist/index.js`);
// Return result object
return window['@yandex/ymaps3-web-mercator-projection'];
});
FAQs
Yandex Maps JS API 3.0 example @yandex/ymaps3-web-mercator-projection
The npm package @yandex/ymaps3-web-mercator-projection receives a total of 0 weekly downloads. As such, @yandex/ymaps3-web-mercator-projection popularity was classified as not popular.
We found that @yandex/ymaps3-web-mercator-projection demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.