mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 10:41:41 +00:00
usar mosaicos en lugar de svg
This commit is contained in:
parent
c5c96c8f3c
commit
05fba76ab8
2 changed files with 9 additions and 15 deletions
|
@ -55,10 +55,6 @@ export default class extends Controller {
|
|||
return [this.lat, this.lng]
|
||||
}
|
||||
|
||||
get svgOverlay () {
|
||||
return this.overlayTarget.querySelector('svg');
|
||||
}
|
||||
|
||||
get bounds () {
|
||||
return [
|
||||
[0, 0],
|
||||
|
@ -72,17 +68,15 @@ export default class extends Controller {
|
|||
get map () {
|
||||
if (!this._map) {
|
||||
this._map = L.map(this.mapTarget, {
|
||||
minZoom: -5,
|
||||
crs: L.CRS.Simple,
|
||||
zoomSnap: 0.1
|
||||
}).setView(this.coords, 13);
|
||||
minZoom: 0,
|
||||
maxZoom: 5
|
||||
}).setView(this.coords, 0);
|
||||
|
||||
const bounds = this.bounds;
|
||||
|
||||
L.svgOverlay(this.svgOverlay, bounds).addTo(this._map);
|
||||
|
||||
this._map.fitBounds(bounds);
|
||||
this._map.setMaxBounds(bounds);
|
||||
this._layer = L.tileLayer(`${this.element.dataset.site}public/map/{z}/{y}/{x}.png`, {
|
||||
minNativeZoom: 0,
|
||||
maxNativeZoom: 5,
|
||||
noWrap: true
|
||||
}).addTo(this._map);
|
||||
}
|
||||
|
||||
return this._map
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.row{ data: { controller: 'non-geo', map: url_for(site.static_files.blobs.find_by_filename('map.svg').attachments.first) } }
|
||||
.row{ data: { controller: 'non-geo', site: site.url } }
|
||||
.d-none{ hidden: true, data: { target: 'non-geo.overlay' }}
|
||||
.col
|
||||
.form-group
|
||||
|
|
Loading…
Reference in a new issue