ymaps-pie-chart-clusterer

Yandex Maps Plugin: Pie Chart Clusterer

  • 所有者: yandex/ymaps-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/ymaps-pie-chart-clusterer
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证Mozilla Public License 2.0
发布数0
创建于2014-11-05 15:35:37
推送于2016-06-29 07:45:49
最后一次提交2016-06-29 14:45:48
星数31
关注者数17
派生数13
提交数12
已启用问题?
问题数6
打开的问题数3
拉请求数3
打开的拉请求数1
关闭的拉请求数1
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?
去到顶部