|
|
|
@ -13584,8 +13584,6 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
_proto.onupdate = function onupdate(vnode) { |
|
|
|
|
var _this2 = this; |
|
|
|
|
|
|
|
|
|
var dom = vnode.dom; |
|
|
|
|
var mapElements = dom.getElementsByClassName('location-map'); |
|
|
|
|
|
|
|
|
@ -13605,7 +13603,7 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
|
|
|
|
|
icon: markerIcon |
|
|
|
|
}).addTo(this.map); |
|
|
|
|
var 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> ' + 'contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>, ' + 'Developed by <a href="https://flarum.it/">Marco Colia</a>', |
|
|
|
|
attribution: 'Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>', |
|
|
|
|
maxZoom: 18, |
|
|
|
|
edgeBufferTiles: 1, |
|
|
|
|
id: 'mapbox/streets-v11', |
|
|
|
@ -13613,9 +13611,6 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
|
|
|
|
|
zoomOffset: -1, |
|
|
|
|
accessToken: publicToken |
|
|
|
|
}).addTo(this.map); |
|
|
|
|
setTimeout(function () { |
|
|
|
|
_this2.map.invalidateSize(); |
|
|
|
|
}, 1000); |
|
|
|
|
this.updateMap(); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
@ -13642,7 +13637,7 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
_proto.save = function save() { |
|
|
|
|
var _this3 = this; |
|
|
|
|
var _this2 = this; |
|
|
|
|
|
|
|
|
|
if (this.search_country == '' || this.search_city == '') { |
|
|
|
|
if (this.location) { |
|
|
|
@ -13656,14 +13651,14 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
|
|
|
|
|
location_longitude: null |
|
|
|
|
}; |
|
|
|
|
user.save(attributes).then(function () { |
|
|
|
|
_this3.search_country = 'France'; |
|
|
|
|
_this3.search_city = ''; |
|
|
|
|
_this3.location = null; |
|
|
|
|
_this2.search_country = 'France'; |
|
|
|
|
_this2.search_city = ''; |
|
|
|
|
_this2.location = null; |
|
|
|
|
flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default.a.alerts.show({ |
|
|
|
|
type: 'success' |
|
|
|
|
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default.a.translator.trans('justoverclock-users-map-location.forum.locationCleared')); |
|
|
|
|
|
|
|
|
|
_this3.updateMap(); |
|
|
|
|
_this2.updateMap(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -13736,9 +13731,9 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
|
|
|
|
|
location_longitude: result.lon |
|
|
|
|
}; |
|
|
|
|
user.save(attributes).then(function () { |
|
|
|
|
_this3.search_country = attributes.location_country || 'France'; |
|
|
|
|
_this3.search_city = ((attributes.location_postcode || '') + ' ' + (attributes.location_city || '')).trim(); |
|
|
|
|
_this3.location = { |
|
|
|
|
_this2.search_country = attributes.location_country || 'France'; |
|
|
|
|
_this2.search_city = ((attributes.location_postcode || '') + ' ' + (attributes.location_city || '')).trim(); |
|
|
|
|
_this2.location = { |
|
|
|
|
lat: attributes.location_latitude, |
|
|
|
|
lon: attributes.location_longitude |
|
|
|
|
}; |
|
|
|
@ -13746,7 +13741,7 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
|
|
|
|
|
type: 'success' |
|
|
|
|
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default.a.translator.trans('justoverclock-users-map-location.forum.locationSaved')); |
|
|
|
|
|
|
|
|
|
_this3.updateMap(); |
|
|
|
|
_this2.updateMap(); |
|
|
|
|
}); |
|
|
|
|
return "break"; |
|
|
|
|
}(); |
|
|
|
@ -13910,7 +13905,7 @@ flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.initializers.add('justov
|
|
|
|
|
icon: markerIcon |
|
|
|
|
}).addTo(map); |
|
|
|
|
var 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>', |
|
|
|
|
attribution: 'Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>', |
|
|
|
|
maxZoom: 18, |
|
|
|
|
edgeBufferTiles: 1, |
|
|
|
|
id: 'mapbox/streets-v11', |
|
|
|
@ -13918,9 +13913,16 @@ flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.initializers.add('justov
|
|
|
|
|
zoomOffset: -1, |
|
|
|
|
accessToken: publicToken |
|
|
|
|
}).addTo(map); |
|
|
|
|
setTimeout(function () { |
|
|
|
|
/*setTimeout(() => { |
|
|
|
|
map.invalidateSize(); |
|
|
|
|
}, 100); |
|
|
|
|
},100);*/ |
|
|
|
|
|
|
|
|
|
function onMapResized() { |
|
|
|
|
map.invalidateSize(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onMapResized(); |
|
|
|
|
new ResizeObserver(onMapResized).observe(mapElement); |
|
|
|
|
}); |
|
|
|
|
Object(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__["extend"])(flarum_forum_components_SettingsPage__WEBPACK_IMPORTED_MODULE_2___default.a.prototype, 'settingsItems', function (items) { |
|
|
|
|
items.add('location', m(_components_AddLocationComponent__WEBPACK_IMPORTED_MODULE_5__["default"], null)); |
|
|
|
|