I haven't yet integrated into a portlet. But the code(javascript) to load more than one direction on a google maps is:
function init() {
if (GBrowserIsCompatible()) {
geoXml = new GGeoXml("path/file.kml");
map = new GMap2(document.getElementById("map"));
GEvent.addListener(map,"addoverlay",function(overlay) {
if(overlay.name){
if (overlay.Known){
} else {
goverlays.push(overlay);
overlay.Known = true;
}
}
});
map.setCenter(new GLatLng(40.647,-3.9111), 5);
map.setUIToDefault();
map.addOverlay(geoXml);
});
}
This code load a KML file. You can have as many points as you want. The file must have the following structure:
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name></name>
<description></description><styleUrl>#exampleStyleMap</styleUrl>
<Style id="highlightPlacemark">
<IconStyle>
<Icon>
<href>incon.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="normalPlacemark">
<IconStyle>
<Icon>
<href>flag.png</href>
</Icon>
</IconStyle>
</Style>
<StyleMap id="exampleStyleMap">
<Pair>
<key>normal</key>
<styleUrl>#normalPlacemark</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#highlightPlacemark</styleUrl>
</Pair>
</StyleMap>
<Placemark>
<name>BARCELONA</name>
<description>Pl. Catalunya </description><styleUrl>#exampleStyleMap</styleUrl>
<styleUrl>#exampleStyleMap</styleUrl>
<Provincia>BARCELONA</Provincia>
<Poblacion>BARCELONA</Poblacion>
<Text>Pl. Catalunya</Text>
<Point>
<coordinates>2.1657333,41.3893159</coordinates>
</Point>
</Placemark>
</Document>
</kml>
Please sign in to flag this as inappropriate.