|
11 | 11 | <div class="loader loader-curtain"></div> |
12 | 12 | <div id='map'></div> |
13 | 13 | <script> |
14 | | - mapboxgl.accessToken = 'pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4M29iazA2Z2gycXA4N2pmbDZmangifQ.-g_vE53SD2WrJ6tFX7QHmA'; |
15 | | - var iServerUrl = "http://117.122.248.69:8090/iserver/services/map-chongqing/rest/maps/chongqing3857/tileFeature.mvt?_cache=false&returnAttributes=true&compressTolerance=-1&width=512&height=512&viewBounds={bbox-epsg-3857}"; |
| 14 | + var iServerUrl = "http://117.122.248.69:8090/iserver/services/map-city/rest/maps/city/tileFeature.mvt?_cache=false&returnAttributes=true&compressTolerance=-1&width=512&height=512&viewBounds={bbox-epsg-3857}"; |
16 | 15 |
|
17 | 16 | var buildingLayer, heightField = "floor", ratio = 15, layerId = "buildings", |
18 | 17 | center = [106.540545, 29.531714]; |
|
38 | 37 | map.on('load', function () { |
39 | 38 | /*绿色风格*/ |
40 | 39 | mapboxgl.supermap.map.setBackground(map, "hsl(47, 26%, 88%)"); |
41 | | - mapboxgl.supermap.map.setPaintProperty(map, '水系多边形@chongqing', 'fill', {'fill-color': 'hsl(205, 56%, 73%)'}); |
42 | | - mapboxgl.supermap.map.setPaintProperty(map, '植被_多边形_R@chongqing', 'fill', {'fill-color': 'hsl(82, 46%, 72%)', 'fill-opacity': 0.4}); |
43 | | - mapboxgl.supermap.map.setPaintProperty(map, ['R_一级道路@chongqing', 'R_二级道路@chongqing'], 'line', {'line-color': '#fff', 'line-width': 2}); |
44 | | - mapboxgl.supermap.map.setPaintProperty(map, ['R_三级道路@chongqing', 'R_四级道路@chongqing'], 'line', {'line-color': 'hsl(0, 0%, 97%)', 'line-width': 1}); |
| 40 | + mapboxgl.supermap.map.setPaintProperty(map, '水系多边形@city', 'fill', {'fill-color': 'hsl(205, 56%, 73%)'}); |
| 41 | + mapboxgl.supermap.map.setPaintProperty(map, '植被_多边形_R@city', 'fill', {'fill-color': 'hsl(82, 46%, 72%)', 'fill-opacity': 0.4}); |
| 42 | + mapboxgl.supermap.map.setPaintProperty(map, ['R_一级道路@city', 'R_二级道路@city'], 'line', {'line-color': '#fff', 'line-width': 2}); |
| 43 | + mapboxgl.supermap.map.setPaintProperty(map, ['R_三级道路@city', 'R_四级道路@city'], 'line', {'line-color': 'hsl(0, 0%, 97%)', 'line-width': 1}); |
45 | 44 |
|
46 | 45 | /*切换蓝色风格*/ |
47 | 46 | mapboxgl.supermap.map.setBackground(map, "#042133"); |
48 | | - mapboxgl.supermap.map.setPaintProperty(map, '水系多边形@chongqing', 'fill', {'fill-color': '#021019'}); |
49 | | - mapboxgl.supermap.map.setPaintProperty(map, '植被_多边形_R@chongqing', 'fill', {'fill-color': '#021019', 'fill-opacity': 0.4}); |
50 | | - mapboxgl.supermap.map.setPaintProperty(map, ['R_一级道路@chongqing', 'R_二级道路@chongqing'], 'line', {'line-color': '#021019', 'line-width': 2}); |
51 | | - mapboxgl.supermap.map.setPaintProperty(map, ['R_三级道路@chongqing', 'R_四级道路@chongqing'], 'line', {'line-color': '#021019', 'line-width': 1}); |
| 47 | + mapboxgl.supermap.map.setPaintProperty(map, '水系多边形@city', 'fill', {'fill-color': '#021019'}); |
| 48 | + mapboxgl.supermap.map.setPaintProperty(map, '植被_多边形_R@city', 'fill', {'fill-color': '#021019', 'fill-opacity': 0.4}); |
| 49 | + mapboxgl.supermap.map.setPaintProperty(map, ['R_一级道路@city', 'R_二级道路@city'], 'line', {'line-color': '#021019', 'line-width': 2}); |
| 50 | + mapboxgl.supermap.map.setPaintProperty(map, ['R_三级道路@city', 'R_四级道路@city'], 'line', {'line-color': '#021019', 'line-width': 1}); |
52 | 51 |
|
53 | 52 | /*加载三维专题图*/ |
54 | 53 | buildingLayer = new mapboxgl.supermap.RankTheme3DLayer(layerId, map, { |
|
0 commit comments