JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://maps.googleapis.com/maps/api/js?sensor=false&ext=.js"></script>
<script src="http://www.staff.org.au/infobox.js"></script>
<div id="trackingT-map"></div>
CSS
#trackingT-map {
height:400px;
width:400px;
}
JavaScript
var map;
var pop_up_info = "border: 0px solid black; background-color: #ffffff; padding:15px; margin-top: 8px; border-radius:10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; box-shadow: 1px 1px #888;";
google.maps.event.addDomListener(window, 'load', initialize);
var store_pins = [];
var pin_marker = [];
var pin_info = [];
var pin_infoop = [];
function initialize() {
var map_center = new google.maps.LatLng(55.144178, -2.254122);
store_pins = [
['Bellingham Co-Op', 55.144178, -2.254122, 'pin', 'bellinghamcoop.jpg', 'Staff at Bellingham Co-Op'],
['Leicester Tigers - Kingston Park', 55.018754, -1.672230, 'rugby', 'kingparktigers.jpg', 'Stu with the Leicester Tigers Rugby Team'],
['The Hawick PSA Team', 55.421825, -2.797123, 'rugby', 'hawickpsa.jpg', 'The Hawick PSA Team']
];
var myOptions = {
zoom: 3,
minZoom: 3,
center: map_center,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("trackingT-map"), myOptions);
// Main Loop
for(i=0;i<store_pins.length;i++)
{
var pos = new google.maps.LatLng(store_pins[i][1], store_pins[i][2]);
var pinIcon = {
url: 'icons/shirtpin.png',
//The size image file.
size: new google.maps.Size(50, 55),
//The point on the image to measure the anchor from. 0, 0 is the top left.
origin: new google.maps.Point(0, 0),
//The x y coordinates of the anchor point on the marker. e.g. If your map marker was a drawing pin then the anchor would be the tip of the pin.
anchor: new google.maps.Point(25, 20)
};
var pinShape = {
coord: [0,0,50,55],
type: 'rect'
};
pin_marker[i] = new google.maps.Marker(
{
position: pos,
map: map,
title: ...