<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Show Polygons</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://tiles.locationiq.com/v2/libs/maplibre-gl/1.15.2/maplibre-gl.js'></script>
<link href='https://tiles.locationiq.com/v2/libs/maplibre-gl/1.15.2/maplibre-gl.css' rel='stylesheet' />
<!--
You need to include the mapbox-gl draw plugin to have interactive drawing controls
-->
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.0.0/mapbox-gl-draw.js'></script>
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.0.0/mapbox-gl-draw.css' type='text/css'/>
<style>
body { margin:0px; padding:0px; }
#map { position:absolute; top:0px; bottom:0px; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script>
//Add your LocationIQ Maps Access Token here (not the API token!)
locationiqKey = 'pk.a5c3fbf2119bfb2275b62eddbccd76b3';
//Define the map and configure the map's theme
var map = new mapboxgl.Map({
container: 'map',
attributionControl: false, //need this to show a compact attribution icon (i) instead of the whole text
style: 'https://tiles.locationiq.com/v2/streets/vector.json?key='+locationiqKey,
zoom: 12,
center: [-122.42, 37.779]
});
map.on('load', function () {
map.addLayer({
'id': 'maine',
'type': 'fill',
'source': {
'type': 'geojson',
'data': {
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [[
[-122.4775065, 37.7882933],
[-122.4752749, 37.7500271],
[-122.4442042, 37.7357740],
[-122.4055804, 37.7363170],
[-122.3932208, 37.7570848],
[-122.3909033, 37.7881577],
[-122.4775065, 37.7882933]
]]
}
}
},
'layout': {},
'paint': {
'fill-color': '#D20C0C',
'fill-opacity': 0.5
}
});
});
</script>
<script defer src="https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon='{"version":"2024.11.0","token":"eeed8a1f76844d1691b8062b0a426f86","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}' crossorigin="anonymous"></script>
</body>
</html>