Editable polygons
This commit is contained in:
parent
5596bd9f61
commit
9413b68ebf
File diff suppressed because one or more lines are too long
@ -17,7 +17,7 @@
|
||||
import L, {
|
||||
FeatureGroup,
|
||||
Icon,
|
||||
LatLngBounds,
|
||||
LatLngBounds, LatLngExpression,
|
||||
LatLngTuple,
|
||||
markerClusterGroup,
|
||||
MarkerClusterGroup,
|
||||
@ -362,7 +362,7 @@ export default abstract class LeafletMap {
|
||||
return L.latLng(lat, lng) as L.LatLng;
|
||||
}
|
||||
|
||||
convertPositionPolygon(expression: Array<[number, number]> | Array<Array<[number, number]>>) {
|
||||
convertPositionPolygon(expression:LatLngExpression[][] | LatLngExpression[][][]) {
|
||||
return (expression as Array<any>).map((el) => {
|
||||
if (el.length === 2 && !el.some(isNaN)) {
|
||||
return el;
|
||||
@ -395,7 +395,7 @@ export default abstract class LeafletMap {
|
||||
}
|
||||
}
|
||||
|
||||
convertPolygonToCustomFormat(expression: Array<Array<any>>): object {
|
||||
convertPolygonToCustomFormat(expression: any[][]): object {
|
||||
return {
|
||||
[this.options.polygonKeyName] : this.convertToPolygonFormat(expression)
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
/// limitations under the License.
|
||||
///
|
||||
|
||||
import L, { LatLngBounds, LatLngLiteral, LatLngTuple } from 'leaflet';
|
||||
import L, {LatLngBounds, LatLngExpression, LatLngLiteral, LatLngTuple} from 'leaflet';
|
||||
import LeafletMap from '../leaflet-map';
|
||||
import { MapImage, PosFuncton, UnitedMapSettings } from '../map-models';
|
||||
import { Observable, ReplaySubject } from 'rxjs';
|
||||
@ -224,7 +224,7 @@ export class ImageMap extends LeafletMap {
|
||||
expression.y * this.height);
|
||||
}
|
||||
|
||||
convertPositionPolygon(expression: Array<[number, number]> | Array<Array<[number, number]>>) {
|
||||
convertPositionPolygon(expression: LatLngExpression[][] | LatLngExpression[][][]) {
|
||||
return (expression as Array<any>).map((el) => {
|
||||
if (el.length === 2 && !el.some(isNaN)) {
|
||||
return this.pointToLatLng(
|
||||
@ -269,7 +269,7 @@ export class ImageMap extends LeafletMap {
|
||||
}
|
||||
}
|
||||
|
||||
convertPolygonToCustomFormat(expression: Array<Array<any>>): object {
|
||||
convertPolygonToCustomFormat(expression: any[][]): object {
|
||||
return {
|
||||
[this.options.polygonKeyName] : this.convertToPolygonFormat(expression)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user