From 276297dcc032a426941413707c1fb07bf55fdd70 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Tue, 22 Jan 2019 11:58:31 +0100 Subject: [PATCH] Center the map on position on first display --- src/components/Map.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/Map.vue b/src/components/Map.vue index 98adb00..9237c60 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -479,6 +479,11 @@ export default { }); this.map.getTargetElement().style.cursor = hit ? 'pointer' : ''; }); + + // Force the map to be centered on the current position if there is any + if (this.olPosition) { + this.recenterMap(); + } }, props: { accuracy: Number,