ymaps-pie-chart-clusterer

Yandex Maps Plugin: Pie Chart Clusterer

  • 所有者: yandex/mapsapi-pie-chart-clusterer
  • 平台:
  • 許可證: Mozilla Public License 2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Yandex Maps API PieChartClusterer Module

PieChartClusterer is an extention of standard Yandex Maps JS API 2.1 Clusterer
that represents numerical proportion of different Placemark
types
in Cluster.
PieChartClusterer class allows to construct and display such representations over geographical maps using PieChart icon.

Loading

  1. Put module source code (pie-chart-clusterer.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/pie-chart-clusterer.min.js" type="text/javascript"></script>
  1. Get access to module functions by using ymaps.modules.require method
ymaps.modules.require(['PieChartClusterer'], function (PieChartClusterer) {
    /**
     * Supports all Clusterer constructor options.
     * @see https://tech.yandex.ru/maps/doc/jsapi/2.1/ref/reference/Clusterer-docpage/
     */
    var clusterer = new PieChartClusterer({margin: 10});
});

Demo

http://yandex.github.io/ymaps-pie-chart-clusterer/

Examples

  • Displaying Clusterer of different Placemark types.
ymaps.ready(function () {
    var myMap = new ymaps.Map('YMapsID', {
        center: [55.7517318022522, 37.61691485505143],
        zoom: 10
    });
    ymaps.modules.require(['PieChartClusterer'], function (PieChartClusterer) {
        var clusterer = new PieChartClusterer();
        var points = [
            new ymaps.Placemark(
                [55.75498702962238, 37.618202315378575],
                {balloonContent: 'museum'},
                {preset: 'islands#brownIcon'}
            ),
            new ymaps.Placemark(
                [55.754662597966856, 37.621551735588916],
                {balloonContent: 'shopping centre'},
                {preset: 'islands#blueIcon'}
            ),
            new ymaps.Placemark(
                [55.753610957072794, 37.6258667510446],
                {balloonContent: 'shopping centre'},
                {preset: 'islands#blueIcon'}
            ),
            new ymaps.Placemark(
                [55.752475871211445, 37.623210672898345],
                {balloonContent: 'temple'},
                {preset: 'islands#greenIcon'}
            ),
            new ymaps.Placemark(
                [55.755421360094026, 37.622878078980506],
                {balloonContent: 'cafe'},
                {preset: 'islands#redIcon'}
            ),
            new ymaps.Placemark(
                [55.75573597375927, 37.62162280516154],
                {balloonContent: 'restaurant'},
                {preset: 'islands#orangeIcon'}
            )
        ];

        clusterer.add(points);
        myMap.geoObjects.add(clusterer);
    });
});

Building

Use ym-builder if re-build is needed.

主要指標

概覽
名稱與所有者yandex/mapsapi-pie-chart-clusterer
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證Mozilla Public License 2.0
所有者活动
創建於2014-11-05 15:35:37
推送於2016-06-29 07:45:49
最后一次提交2016-06-29 14:45:48
發布數0
用户参与
星數31
關注者數16
派生數13
提交數12
已啟用問題?
問題數6
打開的問題數3
拉請求數3
打開的拉請求數1
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?