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

ymaps-regionmap

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ymaps-regionmap

Yandex.Maps API module for data visualization.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Yandex Maps API Regionmap Module

Yandex.Maps API module for data visualization.

Regionmap is a graphical representation of some spatial data, where depending on the number of entered points regions are painted in different colors. Regionmap class allows to construct and display such representations over geographical maps.

Loading

  1. Put module source code (regionmap.min.js) on your CDN.

  2. Load both Yandex Maps JS API 2.1 and module source code by adding following code into <head> section of your page:

    <script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
    <!-- Change my.cdn.tld to your CDN host name -->
    <script src="http://my.cdn.tld/regionmap.min.js" type="text/javascript"></script>
    

    If you use GeoJSON data:

    <script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU&coordOrder=longlat" type="text/javascript"></script>
    <!-- Change my.cdn.tld to your CDN host name -->
    <script src="http://my.cdn.tld/regionmap.min.js" type="text/javascript"></script>
    

    If you use npm:

    <script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
    
    npm i --save git+https://github.com/yandex-shri-fx-team/ymaps-regionmap.git
    
    require('ymaps-regionmap');
    
    // Or with babel
    import 'ymaps-regionmap';
    
  3. Get access to module functions by using ymaps.modules.require method:

    ymaps.modules.require(['Regionmap'], function (Regionmap) {
         var regionmap = new Regionmap();
    });
    

Regionmap

Regionmap module.

Requires: module:option.Manager, module:Polygonmap

Regionmap ⏏

Kind: Exported class

new Regionmap([data], [options])
ParamTypeDescription
[data]ObjectPoints, GeoJSON FeatureCollections.
[options]ObjectOptions for customization. See more options in Polygonmap.
options.regionOptionsobjectOptions for Yandex.Maps API Regions.

regionmap.setMap(map) ⇒ Regionmap

Set Map instance to render Polygonmap object.

Kind: instance method of Regionmap
Returns: Regionmap - Self-reference.
Access: public

ParamTypeDescription
mapMapMap instance.

regionmap.getMap() ⇒ Map

Get the Map instance.

Kind: instance method of Regionmap
Returns: Map - Reference to Map instance.
Access: public

Examples

Displaying regionmap over geographical map

ymaps.modules.require(['Regionmap'], function (Regionmap) {
    const dataPoints = {
            type: 'FeatureCollection',
            features: [{
                id: 'id1',
                type: 'Feature',
                geometry: {
                    type: 'Point',
                    coordinates: [37.782551, -122.445368]
                }
            }, {
                id: 'id2',
                type: 'Feature',
                geometry: {
                    type: 'Point',
                    coordinates: [37.782745, -122.444586]
                }
            }]
        };
    const regionmap = new Regionmap(dataPoints);

    regionmap.setMap(myMap);
});

Demo

Keywords

FAQs

Package last updated on 11 Jun 2018

Did you know?

Socket

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.

Install

Related posts

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