Translate the leaflet control texts
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -10,9 +10,9 @@
|
||||
* to try to trigger location manually (not done ATM)
|
||||
*/
|
||||
|
||||
import L, { DomEvent } from "leaflet";
|
||||
import { DomEvent } from "leaflet";
|
||||
import { findRealParent, propsBinder } from "vue2-leaflet";
|
||||
import "leaflet.locatecontrol";
|
||||
import Locatecontrol from "leaflet.locatecontrol";
|
||||
import { Component, Prop, Vue } from "vue-property-decorator";
|
||||
|
||||
@Component({
|
||||
@@ -37,12 +37,20 @@ export default class Vue2LeafletLocateControl extends Vue {
|
||||
parentContainer: any;
|
||||
|
||||
mounted(): void {
|
||||
this.mapObject = L.control.locate(this.options);
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
this.mapObject = new Locatecontrol({
|
||||
...this.options,
|
||||
strings: { title: this.$t("Show me where I am") as string },
|
||||
});
|
||||
DomEvent.on(this.mapObject, this.$listeners as any);
|
||||
propsBinder(this, this.mapObject, this.$props);
|
||||
this.ready = true;
|
||||
this.parentContainer = findRealParent(this.$parent);
|
||||
this.mapObject.addTo(this.parentContainer.mapObject, !this.visible);
|
||||
this.$nextTick(() => {
|
||||
this.$emit("ready", this.mapObject);
|
||||
});
|
||||
}
|
||||
|
||||
public locate(): void {
|
||||
|
||||
Reference in New Issue
Block a user