mirror of
https://github.com/tabler/tabler.git
synced 2026-08-07 20:02:23 +04:00
d8956a06d6
Co-authored-by: Bartek <xbartoszdobija@gmail.com>
42 lines
1.4 KiB
Plaintext
42 lines
1.4 KiB
Plaintext
---
|
|
// Port of preview/pages/map-fullsize.html.
|
|
// Front matter: layout-wrapper-full + layout-sidebar + layout-hide-topbar,
|
|
// page-libs: [google-maps], page-menu: plugins.map-fullsize. No title / no
|
|
// page-header (the page-header block renders empty in the reference).
|
|
//
|
|
// {% assign map-id = 'google' %} → id="map-google".
|
|
// The {% capture_script %} block is registered synchronously (before any await).
|
|
// We mirror the development build (environment == 'development'), so the
|
|
// `window.tabler_map` bookkeeping lines are emitted (as in the reference).
|
|
//
|
|
// REQUIRES DefaultLayout `wrapperFull` support (see report): page-wrapper-full
|
|
// class + slot rendered WITHOUT the .container-xl wrapper. Not implemented in
|
|
// the shared DefaultLayout yet — flagged rather than modified here.
|
|
import DefaultLayout from '@shared/layouts/DefaultLayout.astro';
|
|
import { addPageScript } from '@shared/lib/page-scripts';
|
|
|
|
addPageScript(`<script>
|
|
let map;
|
|
window.tabler_map = window.tabler_map || {};
|
|
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
map = new google.maps.Map(document.getElementById("map-google"), {
|
|
center: { lat: -34.397, lng: 150.644 },
|
|
zoom: 8,
|
|
});
|
|
|
|
window.tabler_map["map-google"] = map;
|
|
});
|
|
</script>`);
|
|
---
|
|
|
|
<DefaultLayout
|
|
pageMenu="plugins.map-fullsize"
|
|
pageLibs={['google-maps']}
|
|
sidebar
|
|
hideTopbar
|
|
wrapperFull
|
|
>
|
|
<div class="map flex-fill" id="map-google"></div>
|
|
</DefaultLayout>
|