- add '.gitea/workflows/build.yaml'
All checks were successful
Explore-Gitea-Actions
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 11s

- npm updates
- add map tool for drawing rectangles
This commit is contained in:
Kaimbacher 2023-04-12 09:26:45 +02:00
parent a744ae7e5b
commit 12b02a0d7d
6 changed files with 302 additions and 136 deletions

View file

@ -3,7 +3,7 @@
<!-- <Map className="h-36" :center="state.center" :zoom="state.zoom"> // map component content </Map> -->
<div :id="mapId" class="map-container mapDesktop rounded">
<ZoomControlComponent :mapId="mapId"></ZoomControlComponent>
<DrawControlComponent :mapId="mapId"></DrawControlComponent>
<DrawControlComponent :mapId="mapId" :southWest="southWest" :northEast="northEast"></DrawControlComponent>
</div>
</div>
</template>
@ -71,12 +71,16 @@ export default class MapComponent extends Vue {
mapService = MapService();
southWest;
northEast;
/**
* Informs when initialization is done with map id.
*/
public onMapInitializedEvent: EventEmitter<string> = new EventEmitter<string>();
protected map!: Map;
public map!: Map;
// protected drawnItems!: FeatureGroup<any>;
// @Prop({ type: Object })
@ -104,9 +108,9 @@ export default class MapComponent extends Vue {
// if (this.fitBounds) {
// this.map.fitBounds(this.fitBounds);
// }
const southWest = toLatLng(46.5, 9.9);
const northEast = toLatLng(48.9, 16.9);
const bounds = toLatLngBounds(southWest, northEast);
this.southWest = toLatLng(46.5, 9.9);
this.northEast = toLatLng(48.9, 16.9);
const bounds = toLatLngBounds(this.southWest, this.northEast);
map.fitBounds(bounds);
const attributionControl = new Attribution().addTo(this.map);