add cityCoords
params for city chnaged add 'center city' in settings
This commit is contained in:
@@ -24,7 +24,7 @@ export async function showMap(params) {
|
||||
mapparams.map.remove();
|
||||
}
|
||||
}
|
||||
mapparams.map = L.map('map', {scrollWheelZoom: false}).setView(params.center, parseInt(params.zoom))
|
||||
mapparams.map = L.map('map', {scrollWheelZoom: false}).setView(params.center.coords, parseInt(params.zoom))
|
||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: mapparams.MAXZOOM,
|
||||
attribution: '© <a href="http://www.js.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
@@ -51,3 +51,7 @@ const buildMarkers = async (params, mapparams) => {
|
||||
return mapg.buildMarkers(params, mapparams)
|
||||
}
|
||||
}
|
||||
|
||||
export const setNewCenter = (center) => {
|
||||
mapparams.map.setView(center)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user