|
@@ -1,5 +1,6 @@
|
|
|
import http from '../../http'
|
|
|
import { LayerStyle } from '../components/VectorShow'
|
|
|
+import path from 'path'
|
|
|
|
|
|
export const ADDLAYER = Symbol('add_layer')
|
|
|
export const UPDATELAYER = Symbol('update_layer')
|
|
@@ -9,6 +10,7 @@ export const LOADLAYERS = Symbol('load_layers')
|
|
|
export interface Item extends LayerStyle {
|
|
|
show: boolean,
|
|
|
url: string,
|
|
|
+ getUrl: string,
|
|
|
checked: boolean,
|
|
|
lat: number,
|
|
|
lng: number
|
|
@@ -37,6 +39,7 @@ export const defaultLayerStyle = (): Item => ({
|
|
|
show: false,
|
|
|
checked: false,
|
|
|
url: '',
|
|
|
+ getUrl: '',
|
|
|
lat: 0,
|
|
|
lng: 0
|
|
|
})
|
|
@@ -97,9 +100,9 @@ export const getLayersAction = async (dispatch: Dispatch, id: number) => {
|
|
|
...layer,
|
|
|
lat: Number(data.latitude),
|
|
|
lng: Number(data.longitude),
|
|
|
- url: layer.url
|
|
|
+ url: layer.url,
|
|
|
+ getUrl: path.join('/test/a', layer.url, '/{z}/{x}/{y}.pbf')
|
|
|
}
|
|
|
- // url: "../data/mvt/wuyi/{z}/{x}/{y}.pbf",
|
|
|
|
|
|
addLayerAction(dispatch, layer.name, style)
|
|
|
}
|