inMap2.0

inMap 是基于百度地图的大数据可视化库,使用了多线程、采用 canvas 进行绘制、封装了圆点、线段、弧线、多边形、路径、文字以及动画等组件,组件之间效果可以叠加,可以轻松的做出更炫的效果,支持 GeoJSON 地理信息数据格式;致力于让大数据可视化变得简单易用。

特性#

  • 高性能
  • 多线程
  • 支持 GeoJSON
  • 多图层叠加
  • 友好的 API
  • 可以自定义主题

安装#

使用 npm

$ npm install inmap --save

或使用 <script> 全局引用,inMap 会被注册为一个全局变量。

<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=0lPULNZ5PmrFVg76kFuRjezF"></script>
    <script type="text/javascript" src="http://unpkg.com/inmap/dist/inmap.min.js"></script>
    /** 建议CDN方式引用锁定一下版本号,如下: **/
 <script type="text/javascript" src="https://unpkg.com/inmap@2.0.2/dist/inmap.min.js"></script>

inMap 依赖百度地图,需要开发者到百度地图开发平台申请,方可使用百度地图。

示例#

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
    body,
    html {
    width: 100%;
    height: 100%;
    margin: 0;
    font-family: "微软雅黑";
}

        #allmap {
    width: 100%;
    height: 100%;
}

p {
    margin-left: 5px;
    font-size: 14px;
}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=U3q69k0Dv0GCYNiiZeHPf7BS"></script>
    <script type="text/javascript" src="http://unpkg.com/inmap/dist/inmap.min.js"></script>
    <title></title>
    </head>
    <body>
    <div id="allmap"></div>
    </body>

    </html>
    <script>
var data = [{"count":6,"geometry":{"type":"Point","coordinates":["116.395645","39.929986"]}},{"count":6,"geometry":{"type":"Point","coordinates":["121.487899","31.249162"]}},{"count":5,"geometry":{"type":"Point","coordinates":["117.210813","39.14393"]}},{"count":4,"geometry":{"type":"Point","coordinates":["106.530635","29.544606"]}},{"count":4,"geometry":{"type":"Point","coordinates":["117.216005","31.859252"]}},{"count":8,"geometry":{"type":"Point","coordinates":["117.984943","26.050118"]}},{"count":2,"geometry":{"type":"Point","coordinates":["102.457625","38.103267"]}},{"count":9,"geometry":{"type":"Point","coordinates":["113.394818","23.408004"]}},{"count":1,"geometry":{"type":"Point","coordinates":["108.924274","23.552255"]}},{"count":2,"geometry":{"type":"Point","coordinates":["106.734996","26.902826"]}},{"count":0,"geometry":{"type":"Point","coordinates":["109.733755","19.180501"]}},{"count":2,"geometry":{"type":"Point","coordinates":["115.661434","38.61384"]}},{"count":0,"geometry":{"type":"Point","coordinates":["113.486804","34.157184"]}},{"count":9,"geometry":{"type":"Point","coordinates":["128.047414","47.356592"]}},{"count":3,"geometry":{"type":"Point","coordinates":["112.410562","31.209316"]}},{"count":7,"geometry":{"type":"Point","coordinates":["111.720664","27.695864"]}},{"count":7,"geometry":{"type":"Point","coordinates":["119.368489","33.013797"]}},{"count":0,"geometry":{"type":"Point","coordinates":["115.676082","27.757258"]}},{"count":0,"geometry":{"type":"Point","coordinates":["126.262876","43.678846"]}},{"count":4,"geometry":{"type":"Point","coordinates":["122.753592","41.6216"]}},{"count":2,"geometry":{"type":"Point","coordinates":["114.415868","43.468238"]}},{"count":7,"geometry":{"type":"Point","coordinates":["106.155481","37.321323"]}},{"count":5,"geometry":{"type":"Point","coordinates":["96.202544","35.499761"]}},{"count":2,"geometry":{"type":"Point","coordinates":["118.527663","36.09929"]}},{"count":5,"geometry":{"type":"Point","coordinates":["112.515496","37.866566"]}},{"count":7,"geometry":{"type":"Point","coordinates":["109.503789","35.860026"]}},{"count":6,"geometry":{"type":"Point","coordinates":["102.89916","30.367481"]}},{"count":4,"geometry":{"type":"Point","coordinates":["89.137982","31.367315"]}},{"count":1,"geometry":{"type":"Point","coordinates":["85.614899","42.127001"]}},{"count":4,"geometry":{"type":"Point","coordinates":["101.592952","24.864213"]}},{"count":1,"geometry":{"type":"Point","coordinates":["119.957202","29.159494"]}},{"count":8,"geometry":{"type":"Point","coordinates":["114.186124","22.293586"]}},{"count":6,"geometry":{"type":"Point","coordinates":["113.557519","22.204118"]}},{"count":2,"geometry":{"type":"Point","coordinates":["120.961454","23.80406"]}},{"count":0,"geometry":{"type":"Point","coordinates":["117.282699","31.866942"]}},{"count":3,"geometry":{"type":"Point","coordinates":["117.058739","30.537898"]}},{"count":8,"geometry":{"type":"Point","coordinates":["117.35708","32.929499"]}},{"count":5,"geometry":{"type":"Point","coordinates":["115.787928","33.871211"]}},{"count":3,"geometry":{"type":"Point","coordinates":["117.88049","31.608733"]}},{"count":9,"geometry":{"type":"Point","coordinates":["117.494477","30.660019"]}},{"count":3,"geometry":{"type":"Point","coordinates":["118.32457","32.317351"]}},{"count":3,"geometry":{"type":"Point","coordinates":["115.820932","32.901211"]}},{"count":8,"geometry":{"type":"Point","coordinates":["116.791447","33.960023"]}},{"count":9,"geometry":{"type":"Point","coordinates":["117.018639","32.642812"]}},{"count":5,"geometry":{"type":"Point","coordinates":["118.29357","29.734435"]}},{"count":8,"geometry":{"type":"Point","coordinates":["116.505253","31.755558"]}},{"count":1,"geometry":{"type":"Point","coordinates":["118.515882","31.688528"]}},{"count":3,"geometry":{"type":"Point","coordinates":["116.988692","33.636772"]}},{"count":3,"geometry":{"type":"Point","coordinates":["117.819429","30.94093"]}},{"count":9,"geometry":{"type":"Point","coordinates":["118.384108","31.36602"]}},{"count":2,"geometry":{"type":"Point","coordinates":["118.752096","30.951642"]}},{"count":6,"geometry":{"type":"Point","coordinates":["119.330221","26.047125"]}},{"count":2,"geometry":{"type":"Point","coordinates":["117.017997","25.078685"]}},{"count":2,"geometry":{"type":"Point","coordinates":["118.181883","26.643626"]}},{"count":3,"geometry":{"type":"Point","coordinates":["119.542082","26.656527"]}},{"count":9,"geometry":{"type":"Point","coordinates":["119.077731","25.44845"]}},{"count":2,"geometry":{"type":"Point","coordinates":["118.600362","24.901652"]}},{"count":7,"geometry":{"type":"Point","coordinates":["117.642194","26.270835"]}},{"count":7,"geometry":{"type":"Point","coordinates":["118.103886","24.489231"]}},{"count":6,"geometry":{"type":"Point","coordinates":["117.676205","24.517065"]}},{"count":6,"geometry":{"type":"Point","coordinates":["103.823305","36.064226"]}},{"count":4,"geometry":{"type":"Point","coordinates":["104.171241","36.546682"]}},{"count":0,"geometry":{"type":"Point","coordinates":["104.626638","35.586056"]}},{"count":7,"geometry":{"type":"Point","coordinates":["102.917442","34.992211"]}},{"count":6,"geometry":{"type":"Point","coordinates":["98.281635","39.802397"]}},{"count":7,"geometry":{"type":"Point","coordinates":["102.208126","38.516072"]}},{"count":3,"geometry":{"type":"Point","coordinates":["98.508415","39.741474"]}},{"count":4,"geometry":{"type":"Point","coordinates":["103.215249","35.598514"]}},{"count":6,"geometry":{"type":"Point","coordinates":["104.934573","33.39448"]}},{"count":4,"geometry":{"type":"Point","coordinates":["106.688911","35.55011"]}},{"count":6,"geometry":{"type":"Point","coordinates":["107.644227","35.726801"]}},{"count":3,"geometry":{"type":"Point","coordinates":["105.736932","34.584319"]}},{"count":1,"geometry":{"type":"Point","coordinates":["102.640147","37.933172"]}},{"count":2,"geometry":{"type":"Point","coordinates":["100.459892","38.93932"]}},{"count":6,"geometry":{"type":"Point","coordinates":["113.30765","23.120049"]}},{"count":7,"geometry":{"type":"Point","coordinates":["116.630076","23.661812"]}},{"count":4,"geometry":{"type":"Point","coordinates":["113.763434","23.043024"]}},{"count":1,"geometry":{"type":"Point","coordinates":["113.134026","23.035095"]}},{"count":3,"geometry":{"type":"Point","coordinates":["114.713721","23.757251"]}},{"count":7,"geometry":{"type":"Point","coordinates":["114.410658","23.11354"]}},{"count":0,"geometry":{"type":"Point","coordinates":["113.078125","22.575117"]}},{"count":6,"geometry":{"type":"Point","coordinates":["116.379501","23.547999"]}},{"count":7,"geometry":{"type":"Point","coordinates":["110.931245","21.668226"]}},{"count":3,"geometry":{"type":"Point","coordinates":["116.126403","24.304571"]}},{"count":5,"geometry":{"type":"Point","coordinates":["113.040773","23.698469"]}},{"count":9,"geometry":{"type":"Point","coordinates":["116.72865","23.383908"]}},{"count":4,"geometry":{"type":"Point","coordinates":["115.372924","22.778731"]}},{"count":1,"geometry":{"type":"Point","coordinates":["113.594461","24.80296"]}},{"count":7,"geometry":{"type":"Point","coordinates":["114.025974","22.546054"]}},{"count":4,"geometry":{"type":"Point","coordinates":["111.97701","21.871517"]}},{"count":2,"geometry":{"type":"Point","coordinates":["112.050946","22.937976"]}},{"count":8,"geometry":{"type":"Point","coordinates":["110.365067","21.257463"]}},{"count":1,"geometry":{"type":"Point","coordinates":["112.479653","23.078663"]}},{"count":4,"geometry":{"type":"Point","coordinates":["113.42206","22.545178"]}},{"count":8,"geometry":{"type":"Point","coordinates":["113.562447","22.256915"]}},{"count":9,"geometry":{"type":"Point","coordinates":["108.297234","22.806493"]}},{"count":9,"geometry":{"type":"Point","coordinates":["106.631821","23.901512"]}},{"count":8,"geometry":{"type":"Point","coordinates":["109.122628","21.472718"]}},{"count":1,"geometry":{"type":"Point","coordinates":["107.357322","22.415455"]}},{"count":1,"geometry":{"type":"Point","coordinates":["108.351791","21.617398"]}},{"count":8,"geometry":{"type":"Point","coordinates":["110.26092","25.262901"]}},{"count":2,"geometry":{"type":"Point","coordinates":["109.613708","23.103373"]}},{"count":8,"geometry":{"type":"Point","coordinates":["108.069948","24.699521"]}},{"count":4,"geometry":{"type":"Point","coordinates":["111.552594","24.411054"]}},{"count":3,"geometry":{"type":"Point","coordinates":["109.231817","23.741166"]}},{"count":2,"geometry":{"type":"Point","coordinates":["109.422402","24.329053"]}},{"count":7,"geometry":{"type":"Point","coordinates":["108.638798","21.97335"]}},{"count":7,"geometry":{"type":"Point","coordinates":["111.305472","23.485395"]}},{"count":5,"geometry":{"type":"Point","coordinates":["110.151676","22.643974"]}},{"count":7,"geometry":{"type":"Point","coordinates":["106.709177","26.629907"]}},{"count":5,"geometry":{"type":"Point","coordinates":["105.92827","26.228595"]}},{"count":8,"geometry":{"type":"Point","coordinates":["105.300492","27.302612"]}},{"count":8,"geometry":{"type":"Point","coordinates":["104.852087","26.591866"]}},{"count":9,"geometry":{"type":"Point","coordinates":["109.196161","27.726271"]}},{"count":8,"geometry":{"type":"Point","coordinates":["106.93126","27.699961"]}},{"count":3,"geometry":{"type":"Point","coordinates":["104.900558","25.095148"]}},{"count":2,"geometry":{"type":"Point","coordinates":["107.985353","26.583992"]}},{"count":5,"geometry":{"type":"Point","coordinates":["107.523205","26.264536"]}},{"count":2,"geometry":{"type":"Point","coordinates":["110.330802","20.022071"]}},{"count":0,"geometry":{"type":"Point","coordinates":["109.358586","19.216056"]}},{"count":2,"geometry":{"type":"Point","coordinates":["109.656113","18.597592"]}},{"count":1,"geometry":{"type":"Point","coordinates":["109.0113","19.222483"]}},{"count":5,"geometry":{"type":"Point","coordinates":["109.413973","19.571153"]}},{"count":6,"geometry":{"type":"Point","coordinates":["109.996736","19.693135"]}},{"count":7,"geometry":{"type":"Point","coordinates":["108.85101","18.998161"]}},{"count":9,"geometry":{"type":"Point","coordinates":["110.32009","19.490991"]}},{"count":6,"geometry":{"type":"Point","coordinates":["110.414359","19.21483"]}},{"count":1,"geometry":{"type":"Point","coordinates":["109.861849","19.039771"]}},{"count":0,"geometry":{"type":"Point","coordinates":["109.062698","18.658614"]}},{"count":1,"geometry":{"type":"Point","coordinates":["109.724101","19.805922"]}},{"count":3,"geometry":{"type":"Point","coordinates":["109.948661","18.575985"]}},{"count":8,"geometry":{"type":"Point","coordinates":["109.522771","18.257776"]}},{"count":2,"geometry":{"type":"Point","coordinates":["110.063364","19.347749"]}},{"count":8,"geometry":{"type":"Point","coordinates":["110.292505","18.839886"]}},{"count":4,"geometry":{"type":"Point","coordinates":["110.780909","19.750947"]}},{"count":5,"geometry":{"type":"Point","coordinates":["109.51775","18.831306"]}},{"count":7,"geometry":{"type":"Point","coordinates":["114.522082","38.048958"]}},{"count":4,"geometry":{"type":"Point","coordinates":["115.49481","38.886565"]}},{"count":7,"geometry":{"type":"Point","coordinates":["116.863806","38.297615"]}},{"count":4,"geometry":{"type":"Point","coordinates":["117.933822","40.992521"]}},{"count":5,"geometry":{"type":"Point","coordinates":["114.482694","36.609308"]}},{"count":8,"geometry":{"type":"Point","coordinates":["115.686229","37.746929"]}},{"count":7,"geometry":{"type":"Point","coordinates":["116.703602","39.518611"]}},{"count":2,"geometry":{"type":"Point","coordinates":["119.604368","39.945462"]}},{"count":3,"geometry":{"type":"Point","coordinates":["118.183451","39.650531"]}},{"count":3,"geometry":{"type":"Point","coordinates":["114.520487","37.069531"]}},{"count":9,"geometry":{"type":"Point","coordinates":["114.893782","40.811188"]}},{"count":1,"geometry":{"type":"Point","coordinates":["113.649644","34.75661"]}},{"count":1,"geometry":{"type":"Point","coordinates":["114.351807","36.110267"]}},{"count":2,"geometry":{"type":"Point","coordinates":["114.29777","35.755426"]}},{"count":6,"geometry":{"type":"Point","coordinates":["113.211836","35.234608"]}},{"count":7,"geometry":{"type":"Point","coordinates":["114.351642","34.801854"]}},{"count":1,"geometry":{"type":"Point","coordinates":["112.447525","34.657368"]}},{"count":9,"geometry":{"type":"Point","coordinates":["114.046061","33.576279"]}},{"count":0,"geometry":{"type":"Point","coordinates":["112.542842","33.01142"]}},{"count":1,"geometry":{"type":"Point","coordinates":["113.300849","33.745301"]}},{"count":4,"geometry":{"type":"Point","coordinates":["115.026627","35.753298"]}},{"count":0,"geometry":{"type":"Point","coordinates":["111.181262","34.78332"]}},{"count":5,"geometry":{"type":"Point","coordinates":["115.641886","34.438589"]}},{"count":0,"geometry":{"type":"Point","coordinates":["113.91269","35.307258"]}},{"count":3,"geometry":{"type":"Point","coordinates":["114.085491","32.128582"]}},{"count":1,"geometry":{"type":"Point","coordinates":["113.835312","34.02674"]}},{"count":6,"geometry":{"type":"Point","coordinates":["114.654102","33.623741"]}},{"count":4,"geometry":{"type":"Point","coordinates":["114.049154","32.983158"]}},{"count":9,"geometry":{"type":"Point","coordinates":["126.657717","45.773225"]}},{"count":0,"geometry":{"type":"Point","coordinates":["125.02184","46.596709"]}},{"count":2,"geometry":{"type":"Point","coordinates":["124.196104","51.991789"]}},{"count":5,"geometry":{"type":"Point","coordinates":["130.292472","47.338666"]}},{"count":9,"geometry":{"type":"Point","coordinates":["127.50083","50.25069"]}},{"count":0,"geometry":{"type":"Point","coordinates":["130.941767","45.32154"]}},{"count":0,"geometry":{"type":"Point","coordinates":["130.284735","46.81378"]}},{"count":8,"geometry":{"type":"Point","coordinates":["129.608035","44.588521"]}},{"count":2,"geometry":{"type":"Point","coordinates":["131.019048","45.775005"]}},{"count":8,"geometry":{"type":"Point","coordinates":["123.987289","47.3477"]}},{"count":1,"geometry":{"type":"Point","coordinates":["131.171402","46.655102"]}},{"count":0,"geometry":{"type":"Point","coordinates":["126.989095","46.646064"]}},{"count":3,"geometry":{"type":"Point","coordinates":["128.910766","47.734685"]}},{"count":2,"geometry":{"type":"Point","coordinates":["114.3162","30.581084"]}},{"count":6,"geometry":{"type":"Point","coordinates":["114.895594","30.384439"]}},{"count":8,"geometry":{"type":"Point","coordinates":["109.517433","30.308978"]}},{"count":5,"geometry":{"type":"Point","coordinates":["114.906618","30.446109"]}},{"count":2,"geometry":{"type":"Point","coordinates":["115.050683","30.216127"]}},{"count":1,"geometry":{"type":"Point","coordinates":["112.21733","31.042611"]}},{"count":6,"geometry":{"type":"Point","coordinates":["112.241866","30.332591"]}},{"count":0,"geometry":{"type":"Point","coordinates":["112.768768","30.343116"]}},{"count":1,"geometry":{"type":"Point","coordinates":["110.487231","31.595768"]}},{"count":7,"geometry":{"type":"Point","coordinates":["110.801229","32.636994"]}},{"count":0,"geometry":{"type":"Point","coordinates":["113.379358","31.717858"]}},{"count":2,"geometry":{"type":"Point","coordinates":["113.12623","30.649047"]}},{"count":8,"geometry":{"type":"Point","coordinates":["113.387448","30.293966"]}},{"count":1,"geometry":{"type":"Point","coordinates":["114.300061","29.880657"]}},{"count":8,"geometry":{"type":"Point","coordinates":["112.176326","32.094934"]}},{"count":8,"geometry":{"type":"Point","coordinates":["113.935734","30.927955"]}},{"count":4,"geometry":{"type":"Point","coordinates":["111.310981","30.732758"]}},{"count":2,"geometry":{"type":"Point","coordinates":["112.979353","28.213478"]}},{"count":0,"geometry":{"type":"Point","coordinates":["111.653718","29.012149"]}},{"count":5,"geometry":{"type":"Point","coordinates":["113.037704","25.782264"]}},{"count":9,"geometry":{"type":"Point","coordinates":["112.583819","26.898164"]}},{"count":1,"geometry":{"type":"Point","coordinates":["109.986959","27.557483"]}},{"count":2,"geometry":{"type":"Point","coordinates":["111.996396","27.741073"]}},{"count":6,"geometry":{"type":"Point","coordinates":["111.461525","27.236811"]}},{"count":2,"geometry":{"type":"Point","coordinates":["112.935556","27.835095"]}},{"count":9,"geometry":{"type":"Point","coordinates":["109.745746","28.317951"]}},{"count":3,"geometry":{"type":"Point","coordinates":["112.366547","28.588088"]}},{"count":2,"geometry":{"type":"Point","coordinates":["111.614648","26.435972"]}},{"count":3,"geometry":{"type":"Point","coordinates":["113.146196","29.378007"]}},{"count":9,"geometry":{"type":"Point","coordinates":["110.48162","29.124889"]}},{"count":9,"geometry":{"type":"Point","coordinates":["113.131695","27.827433"]}},{"count":7,"geometry":{"type":"Point","coordinates":["118.778074","32.057236"]}},{"count":2,"geometry":{"type":"Point","coordinates":["119.981861","31.771397"]}},{"count":2,"geometry":{"type":"Point","coordinates":["119.030186","33.606513"]}},{"count":9,"geometry":{"type":"Point","coordinates":["119.173872","34.601549"]}},{"count":8,"geometry":{"type":"Point","coordinates":["120.873801","32.014665"]}},{"count":8,"geometry":{"type":"Point","coordinates":["120.619907","31.317987"]}},{"count":7,"geometry":{"type":"Point","coordinates":["118.296893","33.95205"]}},{"count":2,"geometry":{"type":"Point","coordinates":["119.919606","32.476053"]}},{"count":2,"geometry":{"type":"Point","coordinates":["120.305456","31.570037"]}},{"count":0,"geometry":{"type":"Point","coordinates":["117.188107","34.271553"]}},{"count":1,"geometry":{"type":"Point","coordinates":["120.148872","33.379862"]}},{"count":2,"geometry":{"type":"Point","coordinates":["119.427778","32.408505"]}},{"count":8,"geometry":{"type":"Point","coordinates":["119.455835","32.204409"]}},{"count":6,"geometry":{"type":"Point","coordinates":["115.893528","28.689578"]}},{"count":6,"geometry":{"type":"Point","coordinates":["116.360919","27.954545"]}},{"count":5,"geometry":{"type":"Point","coordinates":["114.935909","25.845296"]}},{"count":3,"geometry":{"type":"Point","coordinates":["114.992039","27.113848"]}},{"count":3,"geometry":{"type":"Point","coordinates":["117.186523","29.303563"]}},{"count":8,"geometry":{"type":"Point","coordinates":["115.999848","29.71964"]}},{"count":6,"geometry":{"type":"Point","coordinates":["113.859917","27.639544"]}},{"count":0,"geometry":{"type":"Point","coordinates":["117.955464","28.457623"]}},{"count":5,"geometry":{"type":"Point","coordinates":["114.947117","27.822322"]}},{"count":2,"geometry":{"type":"Point","coordinates":["114.400039","27.81113"]}},{"count":8,"geometry":{"type":"Point","coordinates":["117.03545","28.24131"]}},{"count":8,"geometry":{"type":"Point","coordinates":["125.313642","43.898338"]}},{"count":0,"geometry":{"type":"Point","coordinates":["122.840777","45.621086"]}},{"count":7,"geometry":{"type":"Point","coordinates":["126.435798","41.945859"]}},{"count":8,"geometry":{"type":"Point","coordinates":["126.564544","43.871988"]}},{"count":3,"geometry":{"type":"Point","coordinates":["125.133686","42.923303"]}},{"count":7,"geometry":{"type":"Point","coordinates":["124.391382","43.175525"]}},{"count":7,"geometry":{"type":"Point","coordinates":["124.832995","45.136049"]}},{"count":2,"geometry":{"type":"Point","coordinates":["125.94265","41.736397"]}},{"count":7,"geometry":{"type":"Point","coordinates":["129.485902","42.896414"]}},{"count":7,"geometry":{"type":"Point","coordinates":["123.432791","41.808645"]}},{"count":0,"geometry":{"type":"Point","coordinates":["123.007763","41.118744"]}},{"count":0,"geometry":{"type":"Point","coordinates":["123.778062","41.325838"]}},{"count":1,"geometry":{"type":"Point","coordinates":["120.446163","41.571828"]}},{"count":6,"geometry":{"type":"Point","coordinates":["121.593478","38.94871"]}},{"count":9,"geometry":{"type":"Point","coordinates":["124.338543","40.129023"]}},{"count":8,"geometry":{"type":"Point","coordinates":["123.92982","41.877304"]}},{"count":4,"geometry":{"type":"Point","coordinates":["121.660822","42.01925"]}},{"count":9,"geometry":{"type":"Point","coordinates":["120.860758","40.74303"]}},{"count":2,"geometry":{"type":"Point","coordinates":["121.147749","41.130879"]}},{"count":8,"geometry":{"type":"Point","coordinates":["123.172451","41.273339"]}},{"count":4,"geometry":{"type":"Point","coordinates":["122.073228","41.141248"]}},{"count":3,"geometry":{"type":"Point","coordinates":["123.85485","42.299757"]}},{"count":5,"geometry":{"type":"Point","coordinates":["122.233391","40.668651"]}},{"count":4,"geometry":{"type":"Point","coordinates":["111.660351","40.828319"]}},{"count":6,"geometry":{"type":"Point","coordinates":["105.695683","38.843075"]}},{"count":0,"geometry":{"type":"Point","coordinates":["109.846239","40.647119"]}},{"count":3,"geometry":{"type":"Point","coordinates":["107.423807","40.76918"]}},{"count":8,"geometry":{"type":"Point","coordinates":["118.930761","42.297112"]}},{"count":0,"geometry":{"type":"Point","coordinates":["109.993706","39.81649"]}},{"count":7,"geometry":{"type":"Point","coordinates":["119.760822","49.201636"]}},{"count":1,"geometry":{"type":"Point","coordinates":["122.260363","43.633756"]}},{"count":4,"geometry":{"type":"Point","coordinates":["106.831999","39.683177"]}},{"count":6,"geometry":{"type":"Point","coordinates":["113.112846","41.022363"]}},{"count":4,"geometry":{"type":"Point","coordinates":["116.02734","43.939705"]}},{"count":6,"geometry":{"type":"Point","coordinates":["122.048167","46.083757"]}},{"count":7,"geometry":{"type":"Point","coordinates":["106.206479","38.502621"]}},{"count":5,"geometry":{"type":"Point","coordinates":["106.285268","36.021523"]}},{"count":3,"geometry":{"type":"Point","coordinates":["106.379337","39.020223"]}},{"count":1,"geometry":{"type":"Point","coordinates":["106.208254","37.993561"]}},{"count":1,"geometry":{"type":"Point","coordinates":["105.196754","37.521124"]}},{"count":0,"geometry":{"type":"Point","coordinates":["101.767921","36.640739"]}},{"count":5,"geometry":{"type":"Point","coordinates":["100.223723","34.480485"]}},{"count":6,"geometry":{"type":"Point","coordinates":["102.085207","36.51761"]}},{"count":7,"geometry":{"type":"Point","coordinates":["100.879802","36.960654"]}},{"count":0,"geometry":{"type":"Point","coordinates":["100.624066","36.284364"]}},{"count":2,"geometry":{"type":"Point","coordinates":["97.342625","37.373799"]}},{"count":9,"geometry":{"type":"Point","coordinates":["102.0076","35.522852"]}},{"count":7,"geometry":{"type":"Point","coordinates":["97.013316","33.00624"]}},{"count":4,"geometry":{"type":"Point","coordinates":["117.024967","36.682785"]}},{"count":4,"geometry":{"type":"Point","coordinates":["117.968292","37.405314"]}},{"count":9,"geometry":{"type":"Point","coordinates":["118.583926","37.487121"]}},{"count":0,"geometry":{"type":"Point","coordinates":["116.328161","37.460826"]}},{"count":9,"geometry":{"type":"Point","coordinates":["115.46336","35.26244"]}},{"count":1,"geometry":{"type":"Point","coordinates":["116.600798","35.402122"]}},{"count":4,"geometry":{"type":"Point","coordinates":["117.684667","36.233654"]}},{"count":0,"geometry":{"type":"Point","coordinates":["115.986869","36.455829"]}},{"count":9,"geometry":{"type":"Point","coordinates":["118.340768","35.072409"]}},{"count":6,"geometry":{"type":"Point","coordinates":["120.384428","36.105215"]}},{"count":8,"geometry":{"type":"Point","coordinates":["119.50718","35.420225"]}},{"count":9,"geometry":{"type":"Point","coordinates":["117.089415","36.188078"]}},{"count":9,"geometry":{"type":"Point","coordinates":["122.093958","37.528787"]}},{"count":2,"geometry":{"type":"Point","coordinates":["119.142634","36.716115"]}},{"count":4,"geometry":{"type":"Point","coordinates":["121.309555","37.536562"]}},{"count":8,"geometry":{"type":"Point","coordinates":["117.279305","34.807883"]}},{"count":8,"geometry":{"type":"Point","coordinates":["118.059134","36.804685"]}},{"count":5,"geometry":{"type":"Point","coordinates":["112.550864","37.890277"]}},{"count":0,"geometry":{"type":"Point","coordinates":["113.120292","36.201664"]}},{"count":5,"geometry":{"type":"Point","coordinates":["113.290509","40.113744"]}},{"count":4,"geometry":{"type":"Point","coordinates":["112.867333","35.499834"]}},{"count":2,"geometry":{"type":"Point","coordinates":["112.738514","37.693362"]}},{"count":6,"geometry":{"type":"Point","coordinates":["111.538788","36.099745"]}},{"count":3,"geometry":{"type":"Point","coordinates":["111.143157","37.527316"]}},{"count":1,"geometry":{"type":"Point","coordinates":["112.479928","39.337672"]}},{"count":3,"geometry":{"type":"Point","coordinates":["112.727939","38.461031"]}},{"count":1,"geometry":{"type":"Point","coordinates":["113.569238","37.869529"]}},{"count":7,"geometry":{"type":"Point","coordinates":["111.006854","35.038859"]}},{"count":6,"geometry":{"type":"Point","coordinates":["108.953098","34.2778"]}},{"count":0,"geometry":{"type":"Point","coordinates":["109.038045","32.70437"]}},{"count":4,"geometry":{"type":"Point","coordinates":["107.170645","34.364081"]}},{"count":8,"geometry":{"type":"Point","coordinates":["107.045478","33.081569"]}},{"count":8,"geometry":{"type":"Point","coordinates":["109.934208","33.873907"]}},{"count":9,"geometry":{"type":"Point","coordinates":["108.968067","34.908368"]}},{"count":2,"geometry":{"type":"Point","coordinates":["109.483933","34.502358"]}},{"count":9,"geometry":{"type":"Point","coordinates":["108.707509","34.345373"]}},{"count":5,"geometry":{"type":"Point","coordinates":["109.50051","36.60332"]}},{"count":3,"geometry":{"type":"Point","coordinates":["109.745926","38.279439"]}},{"count":8,"geometry":{"type":"Point","coordinates":["104.067923","30.679943"]}},{"count":5,"geometry":{"type":"Point","coordinates":["102.228565","31.905763"]}},{"count":1,"geometry":{"type":"Point","coordinates":["106.757916","31.869189"]}},{"count":4,"geometry":{"type":"Point","coordinates":["107.494973","31.214199"]}},{"count":0,"geometry":{"type":"Point","coordinates":["104.402398","31.13114"]}},{"count":6,"geometry":{"type":"Point","coordinates":["101.969232","30.055144"]}},{"count":2,"geometry":{"type":"Point","coordinates":["106.63572","30.463984"]}},{"count":5,"geometry":{"type":"Point","coordinates":["105.819687","32.44104"]}},{"count":2,"geometry":{"type":"Point","coordinates":["103.760824","29.600958"]}},{"count":9,"geometry":{"type":"Point","coordinates":["102.259591","27.892393"]}},{"count":6,"geometry":{"type":"Point","coordinates":["105.44397","28.89593"]}},{"count":3,"geometry":{"type":"Point","coordinates":["106.105554","30.800965"]}},{"count":9,"geometry":{"type":"Point","coordinates":["103.84143","30.061115"]}},{"count":7,"geometry":{"type":"Point","coordinates":["104.705519","31.504701"]}},{"count":2,"geometry":{"type":"Point","coordinates":["105.073056","29.599462"]}},{"count":1,"geometry":{"type":"Point","coordinates":["101.722423","26.587571"]}},{"count":0,"geometry":{"type":"Point","coordinates":["105.564888","30.557491"]}},{"count":3,"geometry":{"type":"Point","coordinates":["103.009356","29.999716"]}},{"count":1,"geometry":{"type":"Point","coordinates":["104.633019","28.769675"]}},{"count":7,"geometry":{"type":"Point","coordinates":["104.63593","30.132191"]}},{"count":7,"geometry":{"type":"Point","coordinates":["104.776071","29.359157"]}},{"count":7,"geometry":{"type":"Point","coordinates":["91.111891","29.662557"]}},{"count":6,"geometry":{"type":"Point","coordinates":["81.107669","30.404557"]}},{"count":2,"geometry":{"type":"Point","coordinates":["97.185582","31.140576"]}},{"count":8,"geometry":{"type":"Point","coordinates":["94.349985","29.666941"]}},{"count":7,"geometry":{"type":"Point","coordinates":["92.067018","31.48068"]}},{"count":6,"geometry":{"type":"Point","coordinates":["88.891486","29.269023"]}},{"count":2,"geometry":{"type":"Point","coordinates":["91.750644","29.229027"]}},{"count":2,"geometry":{"type":"Point","coordinates":["87.564988","43.84038"]}},{"count":3,"geometry":{"type":"Point","coordinates":["81.291737","40.61568"]}},{"count":1,"geometry":{"type":"Point","coordinates":["80.269846","41.171731"]}},{"count":5,"geometry":{"type":"Point","coordinates":["88.137915","47.839744"]}},{"count":0,"geometry":{"type":"Point","coordinates":["86.121688","41.771362"]}},{"count":8,"geometry":{"type":"Point","coordinates":["82.052436","44.913651"]}},{"count":7,"geometry":{"type":"Point","coordinates":["87.296038","44.007058"]}},{"count":3,"geometry":{"type":"Point","coordinates":["93.528355","42.858596"]}},{"count":4,"geometry":{"type":"Point","coordinates":["79.930239","37.116774"]}},{"count":7,"geometry":{"type":"Point","coordinates":["75.992973","39.470627"]}},{"count":3,"geometry":{"type":"Point","coordinates":["84.88118","45.594331"]}},{"count":3,"geometry":{"type":"Point","coordinates":["76.137564","39.750346"]}},{"count":2,"geometry":{"type":"Point","coordinates":["86.041865","44.308259"]}},{"count":1,"geometry":{"type":"Point","coordinates":["82.974881","46.758684"]}},{"count":6,"geometry":{"type":"Point","coordinates":["79.198155","39.889223"]}},{"count":3,"geometry":{"type":"Point","coordinates":["89.181595","42.96047"]}},{"count":4,"geometry":{"type":"Point","coordinates":["87.565449","44.368899"]}},{"count":5,"geometry":{"type":"Point","coordinates":["81.297854","43.922248"]}},{"count":8,"geometry":{"type":"Point","coordinates":["102.714601","25.049153"]}},{"count":1,"geometry":{"type":"Point","coordinates":["99.177996","25.120489"]}},{"count":5,"geometry":{"type":"Point","coordinates":["101.529382","25.066356"]}},{"count":5,"geometry":{"type":"Point","coordinates":["100.223675","25.5969"]}},{"count":7,"geometry":{"type":"Point","coordinates":["98.589434","24.44124"]}},{"count":3,"geometry":{"type":"Point","coordinates":["99.713682","27.831029"]}},{"count":6,"geometry":{"type":"Point","coordinates":["103.384065","23.367718"]}},{"count":5,"geometry":{"type":"Point","coordinates":["100.229628","26.875351"]}},{"count":9,"geometry":{"type":"Point","coordinates":["100.092613","23.887806"]}},{"count":9,"geometry":{"type":"Point","coordinates":["98.859932","25.860677"]}},{"count":8,"geometry":{"type":"Point","coordinates":["100.980058","22.788778"]}},{"count":3,"geometry":{"type":"Point","coordinates":["103.782539","25.520758"]}},{"count":1,"geometry":{"type":"Point","coordinates":["103.725021","27.340633"]}},{"count":9,"geometry":{"type":"Point","coordinates":["104.089112","23.401781"]}},{"count":2,"geometry":{"type":"Point","coordinates":["100.803038","22.009433"]}},{"count":3,"geometry":{"type":"Point","coordinates":["102.545068","24.370447"]}},{"count":2,"geometry":{"type":"Point","coordinates":["120.219375","30.259244"]}},{"count":9,"geometry":{"type":"Point","coordinates":["120.137243","30.877925"]}},{"count":2,"geometry":{"type":"Point","coordinates":["120.760428","30.773992"]}},{"count":8,"geometry":{"type":"Point","coordinates":["119.652576","29.102899"]}},{"count":0,"geometry":{"type":"Point","coordinates":["119.929576","28.4563"]}},{"count":7,"geometry":{"type":"Point","coordinates":["121.579006","29.885259"]}},{"count":5,"geometry":{"type":"Point","coordinates":["118.875842","28.95691"]}},{"count":7,"geometry":{"type":"Point","coordinates":["120.592467","30.002365"]}},{"count":3,"geometry":{"type":"Point","coordinates":["121.440613","28.668283"]}},{"count":2,"geometry":{"type":"Point","coordinates":["120.690635","28.002838"]}},{"count":1,"geometry":{"type":"Point","coordinates":["122.169872","30.03601"]}}]
var inmap = new inMap.Map({
    id: 'allmap',
    skin: "Blueness",
    center: [105.403119, 38.028658],
    zoom: {
        value: 5,
        show: true,
        max: 18,
        min: 5
    },
})

var overlay = new inMap.PointOverlay({
    tooltip: {
        show: true,
        formatter: "{count}"
    },
    legend: {
        show: true,
        title: "标题",
        data: ["描述1", "描述2", "描述3", "描述4"],
        formatter: function (start, end) {
            return start + "万~" + (end || "max") + "万";
        }
    },
    style: {
        normal: {
            backgroundColor: 'rgba(200, 200, 50, 1)',
            borderWidth: 1,
            borderColor: "rgba(255,255,255,1)",
            size: 10,
        },
        mouseOver: {
            backgroundColor: 'rgba(200, 200, 200, 1)',
            borderColor: "rgba(255,255,255,1)",
            borderWidth: 4,
        },
        selected: {
            backgroundColor: 'rgba(184,0,0,1)',
            borderColor: "rgba(255,255,255,1)"
        },
        splitList: [{ //设置区间颜色
            start: 0,
            end: 2,
            size: 3,
        },
            {
                start: 2,
                end: 5,
                size: 6,
            },
            {
                start: 5,
                end: 7,
                size: 9,
            },
            {
                start: 7,
                size: 12,
            }
        ],
    },
    data: data,
    event: {
        onMouseClick: function (item, event) {
            //能获取当前点的信息
        }
    }
});
inmap.add(overlay);
</script>

效果
CE9F5BD4F41F4FDC9A1D70B3FC36016A.jpg

版本#

null

兼容#

  • 兼容现代浏览器, 通常兼容 IE11 以上版本。
  • 兼容 IOS、Android 移动端