1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <!--********************************************************************
- * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- *********************************************************************-->
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8" />
- <title data-i18n="resources.title_mapVLayerPolygon"></title>
- <script type="text/javascript" include="jquery" src="../js/include-web.js"></script>
- </head>
- <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
- <div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
- <script type="text/javascript" include="mapv" src="../../dist/leaflet/include-leaflet.js"></script>
- <script type="text/javascript">
- var map = L.map('map', {
- center: [39.93, 116.402],
- zoom: 12
- });
- var host = window.isLocal ? window.server : 'https://iserver.supermap.io';
- var url = host + '/iserver/services/map-china400/rest/maps/ChinaDark';
- L.supermap.tiledMapLayer(url).addTo(map);
- loadData();
- //示例数据来源为百度MapV的加偏数据,iClient未做纠偏处理
- function loadData() {
- $.get('../data/beijing-village.json', function(geojson) {
- var dataSet = new mapv.DataSet(geojson);
- var options = {
- fillStyle: 'rgba(255, 80, 53, 0.8)',
- strokeStyle: 'rgba(250, 255, 53, 0.8)',
- lineWidth: 1,
- draw: 'simple'
- };
- var dataAttr =
- resources.text_dataSources +
- "<a target='_blank' href='https://mapv.baidu.com/examples/beijing-village.html'>MapV</a>";
- L.supermap.mapVLayer(dataSet, options, { attributionPrefix: dataAttr }).addTo(map);
- setTimeout(function() {
- map.openPopup(resources.text_iClient, map.getCenter());
- }, 1000);
- });
- }
- </script>
- </body>
- </html>
|