I am using the Map Module on one of my pages. I am able to load (from a custom query) and display my markers/icons and the info window works correctly when I click on one of the icons on the map.
I would like to extend this functionality to be similiar google maps. They have a data grid to the side of the map that displays the icons, title, links, ratings, etc. I am able to accomplish this same type of functionalty using a web control inside of an OpenSmart module. Here is my issue. I can display the icons in my side data grid with the informaiton, but I want to be able to click the icon in the side datagrid (not on the map) and have the corresponding icon on the map display its info window.
The closest that I can get to this is to get the click event of the icon in the side datagrid and the get the map, create a marker fron the longitude, latitude and icon index, set the center of the map, add the marker overlay and open the info window. Here is the code
function
showMarkerDescription(latitude,longitude,iconindex,description)var ID = '370';var point = new GLatLng(latitude,longitude);var marker = new GMarker(point,eval('ICONS' + ID)[iconindex]);var map = new GMap2(document.getElementById("map370"));new GLatLng(latitude, longitude),10);
The issue is that in order to get the marker to display I have to use the map.setCenter, which centers the map and removes all of the icons. Is there another way to do this, so I don't loose all of the other icons/markers on the map?
{
map.setCenter(
map.addOverlay(marker);
marker.openInfoWindowHtml(description);
}