mostafa_dadgar Posted January 29, 2013 Share Posted January 29, 2013 (edited) hii understand how build and used google map API (w3scholl sample ).but i want display Multiple point on my map.for example 20 upto 2000 point.i can using php and javascript in my websitehow can i buid it? Edited January 29, 2013 by mostafa_dadgar Link to comment Share on other sites More sharing options...
Ingolme Posted January 29, 2013 Share Posted January 29, 2013 Just repeat the new google.maps.Marker() and marker.setMap(); statements as many times as necessary. 2 Link to comment Share on other sites More sharing options...
mostafa_dadgar Posted February 1, 2013 Author Share Posted February 1, 2013 I test but not workplease give me sample code Link to comment Share on other sites More sharing options...
dsonesuk Posted February 1, 2013 Share Posted February 1, 2013 This is a slimmed down version of one i used <!DOCTYPE html><html><head><scriptsrc="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false"></script><script>// Set location to centre onvar myCenter=new google.maps.LatLng(51.508742,-0.120850);// Set other locations in array first title for marker, second coordsvar locations = [['marker title1', -13.530825,-71.957565],['marker title2', -13.531211,-71.961921],['marker title3', -13.531336,-71.960387],['marker title4', -13.533099,-71.960151],['marker title5', -13.533985,-71.960751],['marker title6', -13.535289,-71.962929],['marker title7', -13.516617,-71.978872],['marker title8', -13.515626,-71.975873],['marker title9', -13.531847,-71.984493],['marker title10', -13.50123,-72.031091],['marker title11', -13.163152,-72.54581]];function initialize(){//apply location marker to centre onvar mapProp = { center:myCenter, zoom:5, mapTypeId:google.maps.MapTypeId.ROADMAP };var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);var marker=new google.maps.Marker({position:myCenter,title: 'My centre location marker'});marker.setMap(map);// apply other location markersfor (i = 0; i < locations.length; i++) {marker = new google.maps.Marker({position: new google.maps.LatLng(locations[i][1], locations[i][2]),map: map,title: locations[i][0]});}}google.maps.event.addDomListener(window, 'load', initialize);</script></head><body><div id="googleMap" style="width:500px;height:380px;"></div></body></html> 1 Link to comment Share on other sites More sharing options...
mostafa_dadgar Posted February 1, 2013 Author Share Posted February 1, 2013 tanks a lot Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now