From 3ab2c4a6b6241bedd430e284ecdc0d4124560401 Mon Sep 17 00:00:00 2001 From: Syed Naqvi Date: Fri, 28 Feb 2020 11:09:38 -0500 Subject: [PATCH] set map maxZoom and default location --- src/components/map/map-model.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/map/map-model.js b/src/components/map/map-model.js index 23778ab..848a025 100644 --- a/src/components/map/map-model.js +++ b/src/components/map/map-model.js @@ -33,6 +33,10 @@ export const mapModel = { storage.map.closePopup(); }); storage.map.on("zoom", resetTransitionAnimation); + + // set to default location if user does not allow locating. + const defautLocation = [43.515391, -79.684085]; + storage.map.setView(defautLocation, 12); }, addMapBoxTileLayer: map => { @@ -55,7 +59,7 @@ export const mapModel = { }, locateUserAndSetView() { - storage.map.locate({ setView: true }); + storage.map.locate({ setView: true, maxZoom: 12 }); }, setMapToCompanyAddress() {