JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
$("document").ready(function() {
testF();
});
function testF() {
var locations = [
['Point 1', -29.890542, 158.274856, 4],
['Point 2', -45.923036, 141.259052, 5],
['Point 3', -15.028249, 171.157507, 3],
['Point 4', -21.80010128657071, 151.28747820854187, 2],
['Point 5', -17.950198, 101.259302, 1]
];
var map = new google.maps.Map(document.getElementById('map_r'), {
zoom : 2,
center: new google.maps.LatLng(-35.028249, 151.157507),
mapTypeControl: false, //will remove the top right corner Map type(Satellite/Map)
//scaleControl: false,
navigationControl: false,
mapTypeId: google.maps.MapTypeId.TERRAIN
});
var infowindow = new google.maps.InfoWindow();
var marker, i;
for(i=0;i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
loadingAnotherMap(marker.position);
}
})(marker, i));
} }
</script>
<script type="text/javascript">
function loadingAnotherMap(position){
var map = new...
CSS
#map_r{float:left;}
#map_directions{border:1px solid black;width:120px;height:100px;float:left;}