mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-19 11:33:38 +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]
|
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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue