JSFiddle - React, Tailwind, and code Playground
by sbochan
HTML
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<div id="map"></div>
CSS
#map {
display:block;
width:100%;
height:700px;
float:left;
}
JavaScript
$(function () {
var points = [
[53.9066, 14.2336],
[53.9128, 14.2498],
[53.91, 14.2476],
[53.9584, 14.7349],
[53.91, 14.2476],
[53.91, 14.2476],
[53.2463, 14.0161],
[53.91, 14.2476],
[53.91, 14.2476],
[53.2049, 14.171],
[53.9097, 14.2494],
[53.9296, 14.4544],
[53.1883, 14.0702],
[53.91, 14.2476],
[53.91, 14.2476],
[53.9482, 14.7217],
[53.3627, 14.9559],
[53.3875, 14.6611],
[53.91, 14.2476],
[53.367, 14.5996],
[53.3824, 14.6528],
[53.2639, 14.995],
[53.5492, 14.5706],
[53.4409, 14.5474],
[53.444, 14.5122],
[53.0668, 14.9911],
[53.3885, 14.7725],
[53.9286, 14.4563],
[53.0681, 14.0238],
[53.5432, 14.557],
[53.4582, 14.5261],
[53.4334, 14.5328],
[53.0887, 21.1198],
[53.91, 14.2476],
[53.91, 14.2476],
[53.4766, 14.6039],
[53.9039, 14.2824],
[53.0826, 14.1259],
[53.2569, 14.049],
[53.9058, 14.2431],
[53.5402, 14.5417],
[53.3465, 14.0571],
[53.0925, 14.1182],
[53.4378, 14.5691],
[53.9297, 14.4452],
[53.2084, 21.0271],
[53.3791, 14.619],
[53.1641, 14.2135],
[53.223, 14.0238],
[53.928, 14.4516]
];
var mapOptions = {
center: new google.maps.LatLng(53.9066, 14.2336),
zoom: 12,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: true,
mapTypeControlOptions: {
mapTypeIds: [
google.maps.MapTypeId.ROADMAP,
google.maps.MapTypeId.TERRAIN]
}
};
var map = new google.maps.Map(document.getElementById("map"),
mapOptions);
var info = new google.maps.InfoWindow();
var i = 0,
point,
marker;
setInterval(function(){
point = new google.maps.LatLng(points[i][0],points[i][1]);
if(typeof(marker)!='undefined')
marker.setMap(null);
marker = new google.maps.Marker({
position: point,
map: map,
title: 'aaa'
});
info.setContent('sadasdas');
...