Openlayers 3 热力图

<body>
    <div id="map"></div>
    <script>
        var map = new ol.Map({  //初始化map
            target: 'map',
            layers: [
                new ol.layer.Tile({
                    source: new ol.source.OSM()
                })
            ],
            view: new ol.View({
                center: ol.proj.transform([37.41, 8.82], 'EPSG:4326', 'EPSG:3857'),
                zoom: 4
            })
        });
        var blur = document.getElementById('blur');
        var radius = document.getElementById('radius');
        var heatmap = new ol.layer.Heatmap({
            source: new ol.source.Vector({
                url: 'data/kml/2012_Earthquakes_Mag5.kml',
                projection: 'EPSG:3857',
                format: new ol.format.KML({
                    extractStyles: false
                })
            }),
            blur: 10,
            radius: 10
        });
        map.addLayer(heatmap);
     </script>
</body>

posted @ 2016-11-17 17:01  米娜-火箭  阅读(6863)  评论(1编辑  收藏  举报