I am using the following code to display a Google map in a SharePoint 2013 code snippet.
<style>
#map-canvas {
width: 100%;
height: 500px;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script>
// Add the marker
function initialize() {
var mapOptions = {
zoom: 9,
center: new google.maps.LatLng(5.8579629,-4.2665575)
}
var map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions);
var image = 'https://www.test.com/mymarker.png';
var myLatLng = new google.maps.LatLng(5.8579629,-4.2665575); <<<-- I want my page fields to go in here!
var beachMarker = new google.maps.Marker({
position: myLatLng,
map: map,
icon: image
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div id="map-canvas"></div>
For each location the only thing that changes is the Google co-ordinates (5.8579629,-4.2665575) so I would like to add the co-ordinates to a list which holds the location details and pull that data into the above script. Each location will have its own page.
Is this possible?