Jump to content

How To Use Google Map To Do Like This ?


Manhag

Recommended Posts

I don't know if it changed, but using the regular Google Maps API you could only get like 1000 images per day. That would make this a kind'a worthless idea unless you only needed a few small areas and you saved them to your server.

 

On a side note, nobody is going to write it and do the work for you. You're gonna have to attempt it before anyone (most people) care to help you. The API is pretty easy if you just check out their page.

 

There's also a Javascript API now which I wasn't aware of. Google search "google maps api" and you should find all you need.

What is a "line bet"? I can't seem to work out what that line points to / what the point of it is? As you've already been told though, we're not just going to go read the API documentation and figure out how to do it for you. Post the code you have and explain what it does, and post links to the pages in the API documentation relevant to that code.

line between

 

as i told u

 

i can make a line between 2 fixed points

 

but i can't make a line between center and a fixed point

 

here is the code


<!DOCTYPE html>
<html>
<head>
<script
src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCwID2UsBJvwVKEMx_U53brmIC8EOLsBFo&sensor=false">
</script>

<script>
var bounds = new google.maps.LatLngBounds();
   var length = markers.length;
   for (var i = 0; i < length; i++) {
       bounds.extend(new google.maps.LatLng(markers[i].lat, markers[i].lng));
       map.fitBounds(bounds);
   }


var x=new google.maps.LatLng(52.395715,4.888916);
var stavanger=new google.maps.LatLng(markers[i].lat, markers[i].lng);
var london=new google.maps.LatLng(51.508742,-0.120850);

function initialize()
{
var mapProp = {
 center:x,
 zoom:4,
 mapTypeId:google.maps.MapTypeId.ROADMAP
 };

var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);

var myTrip=[stavanger,london];
var flightPath=new google.maps.Polyline({
 path:myTrip,
 strokeColor:"#0000FF",
 strokeOpacity:0.9,
 strokeWeight:2
 });

flightPath.setMap(map);
}

google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>

<body>
<div id="googleMap" style="width:500px;height:380px;"></div>
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.