fixed map centering
This commit is contained in:
parent
dc102a975f
commit
2b62c5532d
2
js/dist/forum.js
vendored
2
js/dist/forum.js
vendored
File diff suppressed because one or more lines are too long
2
js/dist/forum.js.map
vendored
2
js/dist/forum.js.map
vendored
File diff suppressed because one or more lines are too long
@ -46,6 +46,7 @@ app.initializers.add('justoverclock/users-map-location', () => {
|
||||
});
|
||||
|
||||
let map2 = L.map('map2').setView([this.latitude, this.longitude], 13);
|
||||
let marker = L.marker([this.latitude, this.longitude], { icon: markerIcon }).addTo(map2)/*.bindPopup('A pretty CSS3 popup.<br> Easily customizable.').openPopup();*/
|
||||
let layerUserCard = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
|
||||
attribution:
|
||||
'Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>, Developed by <a href="https://flarum.it/">Marco Colia</a>',
|
||||
@ -56,6 +57,10 @@ app.initializers.add('justoverclock/users-map-location', () => {
|
||||
zoomOffset: -1,
|
||||
accessToken: publicToken,
|
||||
}).addTo(map2);
|
||||
setTimeout(() => {
|
||||
map2.invalidateSize()
|
||||
},800)
|
||||
|
||||
});
|
||||
});
|
||||
extend(SettingsPage.prototype, 'oncreate', function () {
|
||||
@ -86,7 +91,7 @@ app.initializers.add('justoverclock/users-map-location', () => {
|
||||
});
|
||||
|
||||
let map = L.map('map').setView([this.latitude, this.longitude], 13);
|
||||
let marker = L.marker([this.latitude, this.longitude], { icon: markerIcon }).addTo(map);
|
||||
let marker = L.marker([this.latitude, this.longitude], { icon: markerIcon }).addTo(map)
|
||||
let layer = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
|
||||
attribution:
|
||||
'Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> ' +
|
||||
|
Loading…
Reference in New Issue
Block a user