|
|
|
@ -23,7 +23,7 @@ export function getMapOptions(geojson: GeoJSON.FeatureCollection) {
|
|
|
|
|
|
|
|
|
|
const addPolygon = (feature: GeoJSON.Feature) => { |
|
|
|
|
const { geometry, properties } = feature; |
|
|
|
|
const { name, fineType, lngLat, radius, building, water, grass, height } = |
|
|
|
|
const { name, fineType, center, radius, building, water, grass, height } = |
|
|
|
|
properties as any; |
|
|
|
|
const { coordinates } = geometry as GeoJSON.Polygon; |
|
|
|
|
const path = convertPath(coordinates[0]); |
|
|
|
@ -32,11 +32,11 @@ export function getMapOptions(geojson: GeoJSON.FeatureCollection) {
|
|
|
|
|
name, |
|
|
|
|
type: OverlayTypes.Polygon, |
|
|
|
|
}; |
|
|
|
|
if (fineType === "rect") { |
|
|
|
|
if (fineType === OverlayTypes.Rectangle) { |
|
|
|
|
overlay.path = path; |
|
|
|
|
overlay.type = OverlayTypes.Rectangle; |
|
|
|
|
} else if (fineType === "circle") { |
|
|
|
|
overlay.lngLat = lngLat; |
|
|
|
|
} else if (fineType === OverlayTypes.Circle) { |
|
|
|
|
overlay.lngLat = center; |
|
|
|
|
overlay.radius = radius; |
|
|
|
|
overlay.type = OverlayTypes.Circle; |
|
|
|
|
} else { |
|
|
|
|