<html>
<head>
<style type="text/css">
html,
body,
#map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
</head>
<body>
<script src="https://maps.googleapis.com/maps/api/js?sensor=true"></script>
<div id="map-canvas"></div>
<script type="text/javascript">
function initialize() {
// start the geolocation API
if (navigator.geolocation) {
// when geolocation is available on your device, run this function
navigator.geolocation.getCurrentPosition(success);
} else {
// when no geolocation is available, alert this message
alert('Geolocation not supported or not enabled.');
}
}
function success(position){
/* var coords = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
var options = {
zoom: 15,
center: coords,
mapTypeControl: false,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map-canvas"), options);
var marker = new google.maps.Marker({
position: coords,
map: map,
title:"You are here!"
});
*/
//var coords = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
var coords = new google.maps.LatLng(9.17, 79.40);
var mapOptions = {
zoom: 15,
center: coords,
mapTypeId: google.maps.MapTypeId.TERRAIN
};
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
var marker_0 = new google.maps.Marker(
{
position: coords,
title:"0"
}
);
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.