Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle maps - add road directions, circle, postal code areas
    primarykey
    data
    text
    <p>I got a basic map running using google maps v3</p> <p>Next features that I would like to add include:</p> <ul> <li>draw line as road directions instead of direct point to point polyline</li> <li>draw a circle 75 km circle around from a specific point</li> <li>highlight the postal code of a specific point.</li> </ul> <p>I Would appreciate people's thoughts on these topics</p> <pre><code>var geocoder; var map; function fnPresentMap() { geocoder = new google.maps.Geocoder(); var locationArray = new Array(); locationArray[0] = new Array(); locationArray[1] = new Array(); locationArray[0][0] = document.getElementById('LAT_OUT_1').innerHTML; locationArray[0][1] = document.getElementById('LON_OUT_1').innerHTML; locationArray[1][0] = document.getElementById('LAT_OUT_2').innerHTML; locationArray[1][1] = document.getElementById('LON_OUT_2').innerHTML; var latlng = new google.maps.LatLng(44, -75); var myOptions = { zoom: 8, center: latlng, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, navigationControl: true, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map"), myOptions); var myLatlng; var image_name; for (var count = 0; count &lt; locationArray.length; ++count){ image_name = "img/marker_"+(count+1)+".png"; myLatlng = new google.maps.LatLng(locationArray[count][0],locationArray[count][1]); var marker = new google.maps.Marker({ position: myLatlng, map: map, icon: image_name }); } // re-center var centerLocation = new google.maps.LatLng(locationArray[0][0],locationArray[0][1]); map.setCenter(centerLocation); // show line var points = [ new google.maps.LatLng(locationArray[0][0],locationArray[0][1]), new google.maps.LatLng(locationArray[1][0],locationArray[1][1]) ]; var line = new google.maps.Polyline({ map: map, path: points, strokeColor: "#FF0000", strokeWeight: 2, strokeOpacity: 1.0 }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload