<!DOCTYPE html>
<html lang="en">
<head>
    <title>IFC Locator</title>
    <meta property="og:description" content="Style a polygon with the fill layer type." />
    <meta charset='utf-8'>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@3.3.1/dist/maplibre-gl.css' />
    <script src='https://unpkg.com/maplibre-gl@3.3.1/dist/maplibre-gl.js'></script>
    <style>
        body { margin: 0; padding: 0; }
        html, body, #map { height: 100%; }
    </style>
</head>
<body>
<div id="map"></div>
<script>
    var Lat = '{{ Latitude }}';
    var Long = '{{ Longitude }}';
    var fn = '{{ filename }}';
    const cartoVoyagerStyle = {
        version: 8,
        sources: {
            carto: {
                type: 'raster',
                tiles: [
                    'https://a.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png',
                    'https://b.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png',
                    'https://c.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png'
                ],
                tileSize: 256,
                attribution: '&copy; OpenStreetMap contributors &copy; CARTO'
            }
        },
        layers: [
            {
                id: 'carto',
                type: 'raster',
                source: 'carto'
            }
        ]
    };
   
    const map = new maplibregl.Map({
        container: 'map',
        style: cartoVoyagerStyle,
        center: [Long ,Lat],
        zoom: 18
    });

    map.on('load', () => {
        map.addSource('main', {
            'type': 'geojson',
            'data': fn
        });

        map.addLayer({
            'id': 'poly',
            'type': 'fill',
            'source': 'main',
            'layout': {},
            'paint': {
                'fill-color': '	#FF0000',
                'fill-opacity': 0.5
            }
        });
    });
</script>
</body>
</html>
