Required:
Basic knowledge of HTML
Basic knowledge of JavaScript
For Android and iPhone optional sections:
Basic knowledge of Java and Android development for Android
Basic knowledge of Objective C and iPhone development for iPhone
Step 1: Static Map
Step 2:
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=true">
</script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
map.setCenter(initialLocation);
}, function() {
handleNoGeolocation();
});
function handleNoGeolocation(){
//do something
}
}
map.setZoom(16);
var marker = new google.maps.Marker({
map: map,
position: initialLocation,
title: 'Here I am'
});
var circle = new google.maps.Circle({
center: initialLocation,
map: map,
fillOpacity: .33,
radius: accuracy
});
eqLayer.setMap(map);
documentation reference: http://code.google.com/apis/maps/documentation/javascript/overlays.html#KMLLayers
http://code.google.com/apis/maps/documentation/javascript/overlays.html#FusionTables
http://code.google.com/apis/fusiontables/docs/developers_reference.html#Spatial
sample:
http://manomarks.net/ftspatial.html