JSFiddle - React, Tailwind, and code Playground
by Loan Burger
HTML
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<div id="super_map"></div>
CSS
html, body, #super_map {
height: 100%;
margin: 0px;
padding: 0px
}
JavaScript
function initialize()
{
var map = new google.maps.Map(document.getElementById('super_map'),
{
zoom: 14,
center: new google.maps.LatLng(31.44, -100.47)
});
var marker = new google.maps.Marker({
map: map,
data:{
name:'data name property value'
},
position: new google.maps.LatLng(31.44, -100.47)
});
google.maps.event.addListener(marker, 'click', function()
{
alert(marker.data.name)
// infowindow.setContent(marker.data.name);
//infowindow.open(map,marker);
});
}
initialize();