Add the missing leaflet .js.map file. Link to Google Maps from clicked map locations. Allow poup from the sandbox to support target="_blank" links, though that does not work here.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4444 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-09-04 17:44:05 +00:00
parent 5282d19b55
commit 8741841f27
3 changed files with 12 additions and 1 deletions

1
apps/gg/leaflet.js.map Normal file

File diff suppressed because one or more lines are too long

View File

@ -249,9 +249,19 @@ class GgAppElement extends LitElement {
};
}
on_click(event) {
let popup = L.popup()
.setLatLng(event.latlng)
.setContent(`
<div><a target="_top" href="https://www.google.com/maps/@${event.latlng.lat},${event.latlng.lng},${this.leaflet.getZoom()}z">${event.latlng.lat}, ${event.latlng.lng}</a></div>
`)
.openOn(this.leaflet);
}
async update_map() {
if (!this.leaflet) {
this.leaflet = L.map('map', {attributionControl: false, maxZoom: 16, bounceAtZoomLimits: false});
this.leaflet.on({click: this.on_click.bind(this)});
}
let self = this;
let grid_layer = L.GridLayer.extend({

View File

@ -28,7 +28,7 @@
</div>
</div>
<div id="viewPane" class="vbox" style="flex: 1 1; overflow: auto">
<iframe id="document" sandbox="allow-forms allow-scripts allow-top-navigation allow-modals allow-downloads" style="width: 100%; height: 100%; border: 0"></iframe>
<iframe id="document" sandbox="allow-forms allow-scripts allow-top-navigation allow-modals allow-popups allow-downloads" style="width: 100%; height: 100%; border: 0"></iframe>
</div>
</div>
<script>window.litDisableBundleWarning = true;</script>