GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — iClient-JavaScript/examples/mapboxgl/earthquakeHeatMap.html at master · SuperMap/iClient-JavaScript Expand file tree/ Copy pathearthquakeHeatMap.htmlMore file actions 202 lines (188 loc) · 7.05 KB / Copy pathearthquakeHeatMap.htmlFile metadata and controls202 lines (188 loc) · 7.05 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 <!--******************************************************************** * 该示例需要引入 * PapaParse (https://github.com/mholt/PapaParse) * mapbox-gl-enhance (https://iclient.supermap.io/web/libs/mapbox-gl-js-enhance/1.12.1-13/mapbox-gl-enhance.js) *********************************************************************--> <!DOCTYPE html> <html> <head> <meta charset='utf-8' /> <title data-i18n="resources.title_ChinaEarthquakeHeatWGS84"></title> <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> <script type="text/javascript" include="jquery,papaparse" src="../js/include-web.js"></script> <style> body { margin: 0; padding: 0; } #map { position: absolute; top: 0; bottom: 0; width: 100%; } </style> </head> <body> <div id='map'></div> <script type="text/javascript" include='mapbox-gl-enhance' src="../../dist/mapboxgl/include-mapboxgl.js"></script> <script> var host = window.isLocal ? window.server : "https://iserver.supermap.io"; var map = new mapboxgl.Map({ container: 'map', style: { "version": 8, "sources": { "raster-tiles": { "type": "raster", "tiles": [host + '/iserver/services/map-world/rest/maps/World'], "rasterSource":"iserver", "tileSize": 256 } }, "layers": [{ "id": "simple-tiles", "type": "raster", "source": "raster-tiles", "minzoom": 0, "maxzoom": 22 }] }, crs: mapboxgl.CRS.EPSG4326, center: [112, 37.94], zoom: 3 }); map.on('load', function () { $.get("../data/chinaEarthquake.csv", function (response) { var dataObj = Papa.parse(response, { skipEmptyLines: true, header: true }); var data = dataObj.data; var geojson = { "type": "FeatureCollection", "features": [] }; for (var i = 0; i < data.length; i++) { var item = data[i]; var date = new Date(item.date); var year = date.getFullYear(); //2w+地震数据 if (year > 2000 && year < 2015) { var feature = { "type": "feature", "geometry": { "type": "Point", "coordinates": [] }, "properties": { "value": parseFloat(item.level) } }; feature.geometry.coordinates = [parseFloat(item.X), parseFloat(item.Y)]; geojson.features.push(feature); } } map.addSource('earthquakes', { "type": "geojson", "data": geojson }); map.addLayer({ "id": "earthquakes-heat", "type": "heatmap", "source": "earthquakes", "maxzoom": 9, "paint": { "heatmap-weight": [ "interpolate", ["linear"], ["get", "level"], 0, 0, 6, 1 ], "heatmap-intensity": [ "interpolate", ["linear"], ["zoom"], 0, 1, 9, 3 ], "heatmap-color": [ "interpolate", ["linear"], ["heatmap-density"], 0, "rgba(33,102,172,0)", 0.2, "rgb(103,169,207)", 0.4, "rgb(209,229,240)", 0.6, "rgb(253,219,199)", 0.8, "rgb(239,138,98)", 1, "rgb(178,24,43)" ], "heatmap-radius": [ "interpolate", ["linear"], ["zoom"], 0, 2, 9, 20 ], "heatmap-opacity": [ "interpolate", ["linear"], ["zoom"], 7, 1, 9, 0 ], } }); map.addLayer({ "id": "earthquakes-point", "type": "circle", "source": "earthquakes", "minzoom": 7, "paint": { "circle-radius": [ "interpolate", ["linear"], ["zoom"], 7, [ "interpolate", ["linear"], ["get", "level"], 1, 1, 6, 4 ], 16, [ "interpolate", ["linear"], ["get", "level"], 1, 5, 6, 50 ] ], "circle-color": [ "interpolate", ["linear"], ["get", "level"], 1, "rgba(33,102,172,0)", 2, "rgb(103,169,207)", 3, "rgb(209,229,240)", 4, "rgb(253,219,199)", 5, "rgb(239,138,98)", 6, "rgb(178,24,43)" ], "circle-stroke-color": "white", "circle-stroke-width": 1, "circle-opacity": [ "interpolate", ["linear"], ["zoom"], 7, 0, 8, 1 ] } }); }); }); </script> </body> </html> |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |