How can I plot multiple points on a map based upon multiple address in a list report?
I can plot one at a time by adding a HTML tag ("Show Map") as below:
'<a href="#" onClick="displayMap( '''+ [Query1].[Address] +', '+[Query1].[PostCode] +', '+[Query1].[Country]+''')"
> Show Map</a>'
Then have the google map display the results:
<script src="
http://maps.google.com/maps?file=api&v=2&key="GOOGLEK
EY"
type="text/javascript"></s
cript>
<div id="map" style="width: 500px; height: 400px"></div>
<script type="text/javascript">
var map = new GMap2(document.getElementB
yId("map")
);
var geocoder = new GClientGeocoder();
function showAddress(address) {
if (geocoder) {
geocoder.getLatLng(address
, function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 15);
var marker = new GMarker(point);
map.addOverlay(marker);
map.openInfoWindowHtml(map
.getCenter
(), address);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.checkResize();
}
});
}
}
var firstTime=1;
function displayMap (address) {
showAddress(address);
if(Number(firstTime) > 0 ) {
firstTime = 0;
showAddress(address);
}
}
</script>
This is as per the Cognos Support site. But how can I plot multiple addresses (e.g. all addresses returned for a query to identify locations of customers etc.)