shaoxing-geo-tools 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -204,32 +204,32 @@
|
|
|
204
204
|
|
|
205
205
|
## 使用示例
|
|
206
206
|
```javascript
|
|
207
|
-
import
|
|
207
|
+
import geoTools from 'shaoxing-geo-tools'
|
|
208
208
|
|
|
209
209
|
// 设置默认地图视口和边距比例, 也可以不设置,在 batchGetSpaceExtra 和 batchGetLineExtra 传入[1920, 1080]以及0.5
|
|
210
210
|
// setDefault设置后,batchGetSpaceExtra 和 batchGetLineExtra 中缺省就按设置的走
|
|
211
211
|
|
|
212
|
-
setDefault(1920, 1080, 0.3)
|
|
212
|
+
geoTools.setDefault(1920, 1080, 0.3)
|
|
213
213
|
|
|
214
214
|
// 获取行政区划
|
|
215
|
-
const districts = await getDistricts(someGeoJson)
|
|
216
|
-
getDistricts(someGeoJson).then(result => {})
|
|
215
|
+
const districts = await geoTools.getDistricts(someGeoJson)
|
|
216
|
+
geoTools.getDistricts(someGeoJson).then(result => {})
|
|
217
217
|
|
|
218
218
|
// 批量简化
|
|
219
|
-
const simplified = await batchSimplify([complexGeoJson], 11)
|
|
220
|
-
batchSimplify([complexGeoJson], 11).then(result => {})
|
|
219
|
+
const simplified = await geoTools.batchSimplify([complexGeoJson], 11)
|
|
220
|
+
geoTools.batchSimplify([complexGeoJson], 11).then(result => {})
|
|
221
221
|
|
|
222
222
|
// 获取空间信息
|
|
223
|
-
const extras = await batchGetSpaceExtra([polygonGeoJson])
|
|
224
|
-
batchGetSpaceExtra([polygonGeoJson]).then(result => {})
|
|
223
|
+
const extras = await geoTools.batchGetSpaceExtra([polygonGeoJson])
|
|
224
|
+
geoTools.batchGetSpaceExtra([polygonGeoJson]).then(result => {})
|
|
225
225
|
|
|
226
226
|
// 获取绍兴市边界
|
|
227
|
-
const cityBoundary = await getCityBoundary()
|
|
227
|
+
const cityBoundary = await geoTools.getCityBoundary()
|
|
228
228
|
// 或传入简化容差
|
|
229
|
-
const simplifiedCityBoundary = await getCityBoundary(50)
|
|
229
|
+
const simplifiedCityBoundary = await geoTools.getCityBoundary(50)
|
|
230
230
|
|
|
231
231
|
// 获取各区县边界
|
|
232
|
-
const districtBoundary = await getDistrictBoundary()
|
|
232
|
+
const districtBoundary = await geoTools.getDistrictBoundary()
|
|
233
233
|
```
|
|
234
234
|
|
|
235
235
|
## 架构说明
|