Template:Map: Difference between revisions

From Imperial Minerals Wiki
(Created page with "<div id="map" style="height: 400px;"></div> <script> function initMap() { var latitude = parseFloat('{{{latitude}}}'); var longitude = parseFloat('{{{longitude}}}'); var coordinates = { lat: latitude, lng: longitude }; var mapOptions = { center: coordinates, zoom: 15 }; var map = new google.maps.Map(document.getElementById('map'), mapOptions); var marker = new google.maps.Marker({...")
 
No edit summary
Line 1: Line 1:
<div id="map" style="height: 400px;"></div>
<div id="map" style="height: 400px;"></div>
 
<nowiki>
<script>
<script>
     function initMap() {
     function initMap() {
Line 22: Line 22:


<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBIrgq5dZQ8haJIfKHbGco90OpDwYLiXwA&callback=initMap" async defer></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBIrgq5dZQ8haJIfKHbGco90OpDwYLiXwA&callback=initMap" async defer></script>
</nowiki>

Revision as of 18:57, 19 February 2024

<script> function initMap() { var latitude = parseFloat('{{{latitude}}}'); var longitude = parseFloat('{{{longitude}}}'); var coordinates = { lat: latitude, lng: longitude }; var mapOptions = { center: coordinates, zoom: 15 }; var map = new google.maps.Map(document.getElementById('map'), mapOptions); var marker = new google.maps.Marker({ position: coordinates, map: map, title: 'Marker Title' }); } </script> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBIrgq5dZQ8haJIfKHbGco90OpDwYLiXwA&callback=initMap" async defer></script>