Google Maps - Locations and Circle -
hello stackoverflowers,
i trying combine both multiple locations , circle within same map, have had around see how combine 2 different element types have yet find useful.
below example code draws circle:
<head> <script src="http://maps.googleapis.com/maps/api/js?key=aizasydy0kkjitpvd2u7atoawhc9ysh6ohxoiym&sensor=false"> </script> <script> var hotspot=new google.maps.latlng( 29.9597675231189 , -93.9675262286223 ); function initialize() { var mapprop = { center:hotspot, zoom:7, maptypeid:google.maps.maptypeid.roadmap }; var map = new google.maps.map(document.getelementbyid("googlemap"),mapprop); var circle = new google.maps.circle({ center:hotspot, radius:25000, strokecolor:"#0000ff", strokeopacity:0.8, strokeweight:2, fillcolor:"#0000ff", fillopacity:0 }); circle.setmap(map); } google.maps.event.adddomlistener(window, 'load', initialize); </script> </head> <body> <div id="googlemap" style="width:500px;height:380px;"></div> </body> </html> now example if wishied place 2 markers at:
lat 29.937641 long -93.969326 lat 30.063964 long -94.116131
how incorporate above code? or visa versa if had code points how incorporate circle elements?
as in advance!
function initialize() { var mapprop = { center:hotspot, zoom:7, maptypeid:google.maps.maptypeid.roadmap }; var map = new google.maps.map(document.getelementbyid("googlemap"),mapprop); var marker1=new google.maps.marker({map:map, position: new google.maps.latlng(29.937641,-93.969326)}); var marker2=new google.maps.marker({map:map, position: new google.maps.latlng(30.063964 .-94.116131)}); var circle = new google.maps.circle({ center:hotspot, radius:25000, strokecolor:"#0000ff", strokeopacity:0.8, strokeweight:2, fillcolor:"#0000ff", fillopacity:0 }); circle.setmap(map); }
Comments
Post a Comment