5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-04 19:15:44 +00:00

usar mosaicos en lugar de svg

This commit is contained in:
f 2022-02-10 19:00:25 -03:00
parent c5c96c8f3c
commit 05fba76ab8
2 changed files with 9 additions and 15 deletions

View file

@ -55,10 +55,6 @@ export default class extends Controller {
return [this.lat, this.lng] return [this.lat, this.lng]
} }
get svgOverlay () {
return this.overlayTarget.querySelector('svg');
}
get bounds () { get bounds () {
return [ return [
[0, 0], [0, 0],
@ -72,17 +68,15 @@ export default class extends Controller {
get map () { get map () {
if (!this._map) { if (!this._map) {
this._map = L.map(this.mapTarget, { this._map = L.map(this.mapTarget, {
minZoom: -5, minZoom: 0,
crs: L.CRS.Simple, maxZoom: 5
zoomSnap: 0.1 }).setView(this.coords, 0);
}).setView(this.coords, 13);
const bounds = this.bounds; this._layer = L.tileLayer(`${this.element.dataset.site}public/map/{z}/{y}/{x}.png`, {
minNativeZoom: 0,
L.svgOverlay(this.svgOverlay, bounds).addTo(this._map); maxNativeZoom: 5,
noWrap: true
this._map.fitBounds(bounds); }).addTo(this._map);
this._map.setMaxBounds(bounds);
} }
return this._map return this._map

View file

@ -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' }} .d-none{ hidden: true, data: { target: 'non-geo.overlay' }}
.col .col
.form-group .form-group