My Google search skills are failing me today. I can add one pin to a Google map using a UK post code. But I can't find how to add multiple pins from a selection of say 100 post codes.
All help apprecaited!
A map can have up to 10,000 lines, shapes, or places. Select a layer and click where to put the place. A layer can have 2,000 lines, shapes, or places.
You can add multiple locations by opening the map which you have created and then clicking on the Add marker button. From there, as already explained, you can add your locations manually or by using the search box. Now that you have added the locations, you need to embed your map.
You may want to check out the following example. I believe it should be self explanatory for you to follow:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps API Geocoding Demo</title>
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false"
type="text/javascript"></script>
</head>
<body onunload="GUnload()">
<div id="map_canvas" style="width: 400px; height: 300px"></div>
<script type="text/javascript">
var geocoder = new GClientGeocoder();
var map = new GMap2(document.getElementById("map_canvas"));
var i;
var postcodes = [
'SL59JH',
'LU13TQ',
'SR29TD',
'DA75BQ',
'EC1V9B'
];
map.setCenter(new GLatLng(54.00, -3.00), 5);
for (i = 0; i < postcodes.length; i++) {
geocoder.getLatLng(postcodes[i] + ', UK', function (point) {
if (point) {
map.addOverlay(new GMarker(point));
}
});
}
</script>
</body>
</html>
Screenshot:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With