|
48 | 48 | function load() { |
49 | 49 | var includes = (targetScript.getAttribute('include') || "").split(","); |
50 | 50 | var excludes = (targetScript.getAttribute('exclude') || "").split(","); |
| 51 | + // 在线 |
51 | 52 | if (!inArray(excludes, 'leaflet')) { |
52 | | - inputCSS("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.css"); |
53 | | - inputScript("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.js"); |
| 53 | + inputCSS("https://cdn.bootcss.com/leaflet/1.5.1/leaflet.css"); |
| 54 | + inputScript("https://cdn.bootcss.com/leaflet/1.5.1/leaflet.js"); |
| 55 | + } |
| 56 | + if (inArray(includes, 'leaflet.heat')) { |
| 57 | + inputScript("https://cdn.bootcss.com/leaflet.heat/0.2.0/leaflet-heat.js"); |
| 58 | + } |
| 59 | + if (inArray(includes, 'leaflet.markercluster')) { |
| 60 | + inputCSS("https://cdn.bootcss.com/leaflet.markercluster/1.4.1/MarkerCluster.Default.css"); |
| 61 | + inputCSS("https://cdn.bootcss.com/leaflet.markercluster/1.4.1/MarkerCluster.css"); |
| 62 | + inputScript("https://cdn.bootcss.com/leaflet.markercluster/1.4.1/leaflet.markercluster.js"); |
| 63 | + } |
| 64 | + if (inArray(includes, 'leaflet.draw')) { |
| 65 | + inputCSS("https://cdn.bootcss.com/leaflet.draw/1.0.4/leaflet.draw.css"); |
| 66 | + inputScript("https://cdn.bootcss.com/leaflet.draw/1.0.4/leaflet.draw.js"); |
| 67 | + } |
| 68 | + if (inArray(includes, 'leaflet.pm')) { |
| 69 | + inputCSS("https://cdn.bootcss.com/leaflet.pm/2.2.0/leaflet.pm.css"); |
| 70 | + inputScript("https://cdn.bootcss.com/leaflet.pm/2.2.0/leaflet.pm.min.js"); |
| 71 | + } |
| 72 | + if (inArray(includes, 'leaflet.miniMap')) { |
| 73 | + inputCSS("https://cdn.bootcss.com/leaflet-minimap/3.6.1/Control.MiniMap.min.css"); |
| 74 | + inputScript("https://cdn.bootcss.com/leaflet-minimap/3.6.1/Control.MiniMap.min.js"); |
54 | 75 | } |
55 | 76 | if (inArray(includes, 'mapv')) { |
56 | 77 | inputScript("http://mapv.baidu.com/build/mapv.min.js"); |
57 | 78 | } |
58 | 79 | if (inArray(includes, 'turf')) { |
59 | | - inputScript("https://cdnjs.cloudflare.com/ajax/libs/Turf.js/5.1.6/turf.min.js"); |
| 80 | + inputScript("https://cdn.bootcss.com/Turf.js/5.1.6/turf.min.js"); |
60 | 81 | } |
61 | 82 | if (inArray(includes, 'echarts')) { |
62 | | - inputScript("https://cdn.jsdelivr.net/npm/echarts@4.1.0/dist/echarts.min.js"); |
| 83 | + inputScript("https://cdn.bootcss.com/echarts/4.3.0-rc.2/echarts.min.js"); |
| 84 | + } |
| 85 | + if (inArray(includes, 'elasticsearch')) { |
| 86 | + inputScript("https://cdn.bootcss.com/elasticsearch/16.3.0/elasticsearch.js"); |
| 87 | + } |
| 88 | + if (inArray(includes, 'xlsx')) { |
| 89 | + inputScript("https://cdn.bootcss.com/xlsx/0.15.1/xlsx.core.min.js"); |
| 90 | + } |
| 91 | + // 本地 |
| 92 | + if (inArray(includes, 'leaflet.sidebyside')) { |
| 93 | + inputScript("http://iclient.supermap.io/libs/leaflet/plugins/leaflet-side-by-side/leaflet-side-by-side.min.js"); |
63 | 94 | } |
64 | 95 | if (inArray(includes, 'd3')) { |
65 | | - inputScript("http://iclient.supermap.io/web/libs/d3/5.5.0/d3.js"); |
| 96 | + inputScript("http://iclient.supermap.io/web/libs/d3/5.12.0/d3.js"); |
66 | 97 | } |
67 | 98 | if (inArray(includes, 'd3-hexbin')) { |
68 | | - inputScript("https://d3js.org/d3-hexbin.v0.2.min.js"); |
| 99 | + inputScript("https://d3js.org/d3-hexbin.v0.2.min.js"); |
69 | 100 | } |
70 | 101 | if (inArray(includes, 'd3Layer')) { |
71 | 102 | inputScript("http://iclient.supermap.io/libs/leaflet/plugins/leaflet.d3Layer/leaflet-d3Layer.js"); |
72 | 103 | } |
73 | | - if (inArray(includes, 'elasticsearch')) { |
74 | | - inputScript("https://cdnjs.cloudflare.com/ajax/libs/elasticsearch/15.0.0/elasticsearch.min.js"); |
| 104 | + if (inArray(includes, 'osmbuildings')) { |
| 105 | + inputScript("http://iclient.supermap.io/web/libs/osmbuildings/OSMBuildings-Leaflet.js"); |
75 | 106 | } |
76 | | - if (inArray(includes, 'deck')) { |
77 | | - inputScript("http://iclient.supermap.io/web/libs/deck.gl/5.1.3/deck.gl.min.js"); |
| 107 | + if (inArray(includes, 'leaflet-icon-pulse')) { |
| 108 | + inputCSS("http://iclient.supermap.io/libs/leaflet/plugins/leaflet-icon-pulse/L.Icon.Pulse.css"); |
| 109 | + inputScript("http://iclient.supermap.io/libs/leaflet/plugins/leaflet-icon-pulse/L.Icon.Pulse.js"); |
78 | 110 | } |
79 | | - if (inArray(includes, 'xlsx')) { |
80 | | - inputScript("https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.12.13/xlsx.core.min.js"); |
| 111 | + if (inArray(includes, 'deck')) { |
| 112 | + inputScript("http://iclient.supermap.io/web/libs/deck.gl/5.1.3/deck.gl.min.js"); |
81 | 113 | } |
| 114 | + |
| 115 | + // iclient |
82 | 116 | if (!inArray(excludes, 'iclient9-leaflet')) { |
83 | | - if (supportES6()) { |
84 | | - inputScript("../../dist/leaflet/iclient9-leaflet-es6.min.js"); |
85 | | - } else { |
86 | | - inputScript("../../dist/leaflet/iclient9-leaflet.min.js"); |
87 | | - } |
| 117 | + if (supportES6()) { |
| 118 | + inputScript("../../dist/leaflet/iclient9-leaflet-es6.min.js"); |
| 119 | + } else { |
| 120 | + inputScript("../../dist/leaflet/iclient9-leaflet.min.js"); |
| 121 | + } |
88 | 122 | } |
89 | 123 | if (inArray(includes, 'iclient9-leaflet-css')) { |
90 | 124 | inputCSS("../../dist/leaflet/iclient9-leaflet.min.css"); |
|
97 | 131 | inputScript("http://iclient.supermap.io/web/libs/plotting/leaflet/10.0.0/iclient9-plot-leaflet.min.js"); |
98 | 132 | } |
99 | 133 | } |
100 | | - if (inArray(includes, 'leaflet.heat')) { |
101 | | - inputScript("https://cdnjs.cloudflare.com/ajax/libs/leaflet.heat/0.2.0/leaflet-heat.js"); |
102 | | - } |
103 | | - if (inArray(includes, 'osmbuildings')) { |
104 | | - inputScript("http://iclient.supermap.io/web/libs/osmbuildings/OSMBuildings-Leaflet.js"); |
105 | | - } |
106 | | - if (inArray(includes, 'leaflet.markercluster')) { |
107 | | - inputCSS("https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.3.0/MarkerCluster.Default.css"); |
108 | | - inputCSS("https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.3.0/MarkerCluster.css"); |
109 | | - inputScript("https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.3.0/leaflet.markercluster.js"); |
110 | | - } |
111 | | - if (inArray(includes, 'leaflet-icon-pulse')) { |
112 | | - inputCSS("http://iclient.supermap.io/libs/leaflet/plugins/leaflet-icon-pulse/L.Icon.Pulse.css"); |
113 | | - inputScript("http://iclient.supermap.io/libs/leaflet/plugins/leaflet-icon-pulse/L.Icon.Pulse.js"); |
114 | | - } |
115 | | - if (inArray(includes, 'leaflet.draw')) { |
116 | | - inputCSS("http://iclient.supermap.io/web/libs/leaflet/plugins/leaflet.draw/1.0.2/leaflet.draw.css"); |
117 | | - inputScript("https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.2/leaflet.draw.js"); |
118 | | - } |
119 | | - if (inArray(includes, 'leaflet.pm')) { |
120 | | - inputCSS("http://iclient.supermap.io/web/libs/leaflet/plugins/leaflet.pm/0.25.0/leaflet.pm.css"); |
121 | | - inputScript("http://iclient.supermap.io/web/libs/leaflet/plugins/leaflet.pm/0.25.0/leaflet.pm.min.js"); |
122 | | - } |
123 | | - if (inArray(includes, 'leaflet.miniMap')) { |
124 | | - inputCSS("http://iclient.supermap.io/web/libs/leaflet/plugins/leaflet-miniMap/3.6.1/dist/Control.MiniMap.min.css"); |
125 | | - inputScript("http://iclient.supermap.io/web/libs/leaflet/plugins/leaflet-miniMap/3.6.1/dist/Control.MiniMap.min.js"); |
126 | | - } |
127 | | - if (inArray(includes, 'leaflet.sidebyside')) { |
128 | | - inputScript("http://iclient.supermap.io/libs/leaflet/plugins/leaflet-side-by-side/leaflet-side-by-side.min.js"); |
129 | | - } |
130 | 134 | } |
131 | 135 |
|
132 | 136 |
|
|
0 commit comments