@@ -15,7 +15,7 @@ import Measurer from './components/features/Measurer.vue';
1515import FeatureCollectionEditor from ' ./components/features/FeatureCollectionEditor.vue' ;
1616import ShowEditorButton from ' ./components/features/ShowEditorButton.vue' ;
1717
18- import { DrawManager , GeoJSONLayerManager , MeasureManager , TIdentityGeoJSONFeature , MiddleButtonRoate } from ' ../../packages/maplugin-maplibre' ;
18+ import { DrawManager , GeoJSONLayerManager , MeasureManager , TIdentityGeoJSONFeature , MiddleButtonRoate , VertexEditor } from ' ../../packages/maplugin-maplibre' ;
1919import { StoreEditor } from ' ./stores' ;
2020
2121import img_marker from ' ./assets/map-marker.png?url' ;
@@ -47,6 +47,7 @@ function handleMapLoaded(map: maplibregl.Map) {
4747 });
4848 const drawManager = new DrawManager (glManager );
4949 const measureManager = new MeasureManager (glManager );
50+ const vertexEditor = new VertexEditor (map );
5051
5152 map .loadImage (img_marker ).then ((img ) => {
5253 map .addImage (" marker" , img .data );
@@ -60,6 +61,19 @@ function handleMapLoaded(map: maplibregl.Map) {
6061 layout [' icon-anchor' ] = ' bottom' ;
6162 });
6263
64+ map .on (' click' , drawManager .id_layer_polygon , ({ features }) => {
65+ if (drawManager .drawing || ! features || features .length === 0 ) return ;
66+ const f = glManager .query ((features [0 ].properties as any )[' id' ]);
67+ if (f ) {
68+ glManager .setFeatureHidden (f .properties .id );
69+ vertexEditor .setFeature (f , feature => {
70+
71+ glManager .clearFeatureHidden ();
72+ glManager .update (feature );
73+ });
74+ }
75+ });
76+
6377 createMapControl (map , ShowEditorButton );
6478 createMapControl (map , Drawer , { drawManager }, ' top-left' );
6579 createMapControl (map , Measurer , { measureManager }, ' top-left' );
0 commit comments