Skip to content

Commit b895969

Browse files
新增maplibregl overlay
1 parent 3a99cd9 commit b895969

File tree

104 files changed

+13034
-2606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+13034
-2606
lines changed

dist/maplibregl/include-maplibregl.js

Lines changed: 110 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,122 @@
5252
function load({ libsurl }) {
5353
var includes = (targetScript.getAttribute('include') || '').split(',');
5454
var excludes = (targetScript.getAttribute('exclude') || '').split(',');
55-
inputCSS('https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css');
56-
inputScript('https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js');
55+
inputCSS('https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css');
56+
inputScript('https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js');
57+
if (inArray(includes, 'turf')) {
58+
inputScript(`${libsurl}/turf/6.5.0/turf.min.js`);
59+
}
5760
if (inArray(includes, 'draw')) {
5861
inputCSS(`${libsurl}/mapbox-gl-js/plugins/mapbox-gl-draw/1.4.1/mapbox-gl-draw.min.css`);
5962
inputScript(`${libsurl}/mapbox-gl-js/plugins/mapbox-gl-draw/1.4.1/mapbox-gl-draw.min.js`);
6063
}
64+
6165
if (inArray(includes, 'mapboxgl-draw-rectangle-drag')) {
6266
inputScript(`${libsurl}/mapboxgl-draw-rectangle-drag/1.0.1/mapboxgl-draw-rectangle-drag.browser.js`);
67+
}
68+
if (inArray(includes, 'compare')) {
69+
inputCSS(`${libsurl}/mapbox-gl-js/plugins/mapbox-gl-compare/0.4.0/mapbox-gl-compare.css`);
70+
inputScript(`${libsurl}/mapbox-gl-js/plugins/mapbox-gl-compare/0.4.0/mapbox-gl-compare.js`);
71+
}
72+
if (inArray(includes, 'mapv')) {
73+
inputScript(`${libsurl}/mapv/2.0.62/mapv.min.js`);
74+
}
75+
if (inArray(includes, 'echarts')) {
76+
inputScript(`${libsurl}/echarts/4.9.0/echarts.min.js`);
77+
inputScript(`${libsurl}/echarts-liquidfill/2.0.6/echarts-liquidfill.min.js`);
78+
inputScript(`${libsurl}/echartsLayer/EchartsLayer.min.js`);
79+
}
80+
if (inArray(includes, 'echarts-vue')) {
81+
inputScript(`${libsurl}/echarts/4.9.0/echarts.min.js`);
82+
inputScript(`${libsurl}/vue-echarts/4.1.0/vue-echarts.min.js`);
83+
inputScript(`${libsurl}/echarts-liquidfill/2.0.6/echarts-liquidfill.min.js`);
84+
inputScript(`${libsurl}/echartsLayer/EchartsLayer.min.js`);
85+
}
86+
if (inArray(includes, 'three')) {
87+
inputScript(`${libsurl}/three/0.150.1/three.min.js`);
88+
}
89+
if (inArray(includes, 'three@0.121.1')) {
90+
inputScript(`${libsurl}/three/0.121.1/build/three.js`);
91+
}
92+
if (inArray(includes, 'xlsx')) {
93+
inputScript(`${libsurl}/xlsx/0.19.3/xlsx.core.min.js`);
94+
}
95+
if (inArray(includes, 'proj4')) {
96+
inputScript(`${libsurl}/proj4/2.9.0/proj4.min.js`);
97+
}
98+
if (inArray(includes, 'shapefile')) {
99+
inputScript(`${libsurl}/shapefile/shapefile.js`);
100+
}
101+
if (inArray(includes, 'ant-design-vue')) {
102+
inputCSS(`${libsurl}/ant-design-vue/1.7.8/antd.min.css`);
103+
inputScript(`${libsurl}/ant-design-vue/1.7.8/antd.min.js`);
104+
}
105+
if (inArray(includes, 'antd')) {
106+
inputCSS(`${libsurl}/antd/3.25.3/antd.min.css`);
107+
inputScript(`${libsurl}/moment/2.29.4/moment.min.js`);
108+
inputScript(`${libsurl}/antd/3.25.3/antd.min.js`);
109+
}
110+
if (inArray(includes, 'deck')) {
111+
inputScript(`${libsurl}/deck.gl/5.1.3/deck.gl.min.js`);
112+
}
113+
if (inArray(includes, 'jsonsql')) {
114+
inputScript(`${libsurl}/jsonsql/jsonsql.js`);
115+
}
116+
if (inArray(includes, 'geostats')) {
117+
inputScript(`${libsurl}/geostats/geostats.js`);
118+
}
119+
if (inArray(includes, 'canvg')) {
120+
inputScript(`${libsurl}/canvg/3.0.10/umd.min.js`);
121+
}
122+
if (inArray(includes, 'convert')) {
123+
inputScript(`${libsurl}/xml-js/1.6.8/xml-js.min.js`);
124+
}
125+
if (inArray(includes, 'LegacyJSONLoader')) {
126+
inputScript(`${libsurl}/three/0.110.0/examples/js/loaders/deprecated/LegacyJSONLoader.js`);
127+
}
128+
if (inArray(includes, 'OBJLoader')) {
129+
inputScript(`${libsurl}/three/0.129.0/examples/js/loaders/OBJLoader.js`);
130+
}
131+
132+
if (inArray(includes, 'three92')) {
133+
inputScript(`${libsurl}/three/92/three.min.js`);
134+
}
135+
if (inArray(includes, 'LoaderSupport')) {
136+
inputScript(`${libsurl}/three/plugins/loaders/LoaderCommons.js`);
137+
inputScript(`${libsurl}/three/plugins/loaders/LoaderBuilder.js`);
138+
inputScript(`${libsurl}/three/plugins/loaders/LoaderWorkerSupport.js`);
139+
}
140+
if (inArray(includes, 'OBJLoader2')) {
141+
inputScript(`${libsurl}/three-wtm/1.0.0/three-wtm.js`);
142+
inputScript(`${libsurl}/wwobjloader2/4.0.0/wwobjloader2.js`);
143+
}
144+
if (inArray(includes, 'MTLLoader')) {
145+
inputScript(`${libsurl}/three/0.129.0/examples/js/loaders/MTLLoader.js`);
146+
}
147+
if (inArray(includes, 'GLTFLoader')) {
148+
inputScript(`${libsurl}/three/0.129.0/examples/js/loaders/GLTFLoader.js`);
149+
}
150+
if (inArray(includes, 'echarts-gl')) {
151+
inputScript(`${libsurl}/echarts-gl/1.1.2-fix/echarts-gl.min.js`);
152+
}
153+
if (inArray(includes, 'mapbox-print-pdf')) {
154+
inputScript(`${libsurl}/mapbox-print-pdf/0.4.4/mapbox-print-pdf.min.js`);
155+
}
156+
if (inArray(includes, 'moment')) {
157+
inputScript(`${libsurl}/moment/2.29.4/moment.min.js`);
158+
}
159+
if (inArray(includes, 'lodash')) {
160+
inputScript(`${libsurl}/lodash/4.17.21/lodash.min.js`);
161+
}
162+
if (inArray(includes, 'tensorflow')) {
163+
inputScript(`${libsurl}/tensorflow/3.9.0/tf.min.js`);
164+
}
165+
if (inArray(includes, 'videojs')) {
166+
inputCSS(`${libsurl}/video-js/7.10.2/video-js.min.css`);
167+
inputScript(`${libsurl}/video-js/7.10.2/video.min.js`);
168+
}
169+
if (inArray(includes, 'FGB')) {
170+
inputScript(`${libsurl}/flatgeobuf-geojson/3.23.1/flatgeobuf-geojson.min.js`);
63171
}
64172
if (!inArray(excludes, 'iclient-maplibregl')) {
65173
if (supportES6()) {
@@ -68,12 +176,6 @@
68176
inputScript('../../dist/maplibregl/iclient-maplibregl.min.js');
69177
}
70178
}
71-
if (inArray(includes, 'turf')) {
72-
inputScript(`${libsurl}/turf/6.5.0/turf.min.js`);
73-
}
74-
if (!inArray(excludes, 'iclient-maplibregl-css')) {
75-
inputCSS('../../dist/maplibregl/iclient-maplibregl.min.css');
76-
}
77179
}
78180

79181
load({

examples/mapboxgl/fgb_all_load.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
" Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span>";
3434
var host = window.isLocal ? window.server : 'https://iserver.supermap.io';
3535
var baseUrl = host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?z={z}&x={x}&y={y}';
36-
var fgbUrl = 'https://iclient.supermap.io/minio/fgb/roads.fgb';
36+
var fgbUrl = 'https://iclient.supermap.io/minio/fgb/waterways.fgb';
3737

3838
var map = new mapboxgl.Map({
3939
container: 'map',

examples/mapboxgl/mapvLayerHoneycomb.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@
6262
});
6363
map.addControl(new mapboxgl.NavigationControl(), 'top-left');
6464
map.addControl(new mapboxgl.supermap.LogoControl({ link: "https://iclient.supermap.io" }), 'bottom-right');
65-
loadData();
65+
map.on('load', function() {
66+
loadData();
67+
});
6668

6769
function loadData() {
6870
var randomCount = 1000;

examples/mapboxgl/threejsLayer_bird.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@
8585
});
8686
map.addControl(new mapboxgl.NavigationControl(), 'top-left');
8787

88-
loaderModels();
88+
map.on('load', () => {
89+
loaderModels();
90+
});
8991

9092
function loaderModels() {
9193
threeLayer = new mapboxgl.supermap.ThreeLayer('three');
@@ -157,10 +159,9 @@
157159
});
158160
}
159161

160-
threeLayer.addTo(map);
162+
// threeLayer.addTo(map);
163+
map.addLayer(threeLayer);
161164
}
162-
163-
164165
</script>
165166
</body>
166167
</html>

0 commit comments

Comments
 (0)