|
| 1 | +<!--******************************************************************** |
| 2 | +* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. |
| 3 | +*********************************************************************--> |
| 4 | +<!DOCTYPE html> |
| 5 | +<html> |
| 6 | + <head> |
| 7 | + <meta charset="UTF-8" /> |
| 8 | + <title data-i18n="resources.title_widgetsRaster_Vue"></title> |
| 9 | + <script type="text/javascript" include="vue,jquery,papaparse" src="../js/include-web.js"></script> |
| 10 | + <script |
| 11 | + include="iclient9-mapboxgl-widgets-vue,mapbox-gl-enhance" |
| 12 | + src="../../dist/mapboxgl/include-mapboxgl.js" |
| 13 | + ></script> |
| 14 | + <style> |
| 15 | + #main { |
| 16 | + margin: 0 auto; |
| 17 | + width: 100%; |
| 18 | + height: 100%; |
| 19 | + } |
| 20 | + </style> |
| 21 | + </head> |
| 22 | + |
| 23 | + <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;"> |
| 24 | + <div id="main"> |
| 25 | + <sm-map :map-options="mapOptions"> |
| 26 | + <sm-geojson-layer :layer-style="layerStyle" :data="data"></sm-geojson-layer> |
| 27 | + <sm-layer-list position="top-left"></sm-layer-list> |
| 28 | + </sm-map> |
| 29 | + </div> |
| 30 | + <script> |
| 31 | + let data; |
| 32 | + $.get("../data/全国671个气象站观测数据.geojson", function(res) { |
| 33 | + data = res; |
| 34 | + new Vue({ |
| 35 | + el: "#main", |
| 36 | + data() { |
| 37 | + var host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090"; |
| 38 | + var attribution = |
| 39 | + "<a href='https://www.mapbox.com/about/maps/' target='_blank'>© Mapbox </a>" + |
| 40 | + " with <span>© <a href='http://iclient.supermap.io' target='_blank'>SuperMap iClient</a> | </span>" + |
| 41 | + " Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> "; |
| 42 | + return { |
| 43 | + data: data, |
| 44 | + layerStyle: new SuperMap.Widgets.commontypes.CircleStyle({ |
| 45 | + "circle-color": "#3fb1e3", |
| 46 | + "circle-radius": 6 |
| 47 | + }), |
| 48 | + mapOptions: { |
| 49 | + container: "map", // container id |
| 50 | + style: { |
| 51 | + version: 8, |
| 52 | + sources: { |
| 53 | + "raster-tiles": { |
| 54 | + attribution: attribution, |
| 55 | + type: "raster", |
| 56 | + tiles: [ |
| 57 | + host + |
| 58 | + "/iserver/services/map-china400/rest/maps/ChinaDark/zxyTileImage.png?z={z}&x={x}&y={y}" |
| 59 | + ], |
| 60 | + tileSize: 256 |
| 61 | + } |
| 62 | + }, |
| 63 | + layers: [ |
| 64 | + { |
| 65 | + id: "simple-tiles", |
| 66 | + type: "raster", |
| 67 | + source: "raster-tiles", |
| 68 | + minzoom: 0, |
| 69 | + maxzoom: 22 |
| 70 | + } |
| 71 | + ] |
| 72 | + }, |
| 73 | + center: [120.143, 30.236], |
| 74 | + zoom: 3 |
| 75 | + } |
| 76 | + }; |
| 77 | + } |
| 78 | + }); |
| 79 | + }); |
| 80 | + </script> |
| 81 | + </body> |
| 82 | +</html> |
0 commit comments