Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsMapMapDisplay marker descriptionDisplay marker description
Previous
 
Next
New Post
10/14/2008 7:15 AM
 

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);

}

 
New Post
10/15/2008 9:01 AM
 

The function text was messed up. Here is what the function should have looked like.

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"));
map.setCenter(new GLatLng(latitude, longitude),10);
map.addOverlay(marker);
marker.openInfoWindowHtml(description);
}

 
New Post
10/24/2008 2:05 PM
 

I ended up using the IE DebugBar to find out that the map creates an array called LISTENERS which contain the "click" event listeners for the markers, which call the marker.openInfoWindowHtml(html) function.

Once I knew this I looped through the properties of one of the objects in the LISTENERS + ID array (where ID was in my case was 370) and alerted the properties until I found the one which had a value of function(){marker.openInfoWindowHtml(html);} it was called Ng.

So at this point I had a handle on the event listener and the property to call. To call this property took the following line of code

LISTENERS370[index]['Ng'].call();

The index is the index of the icon that I wanted to display the info window for.

So in summary on the click event of the icon in my side bar I call the following function with the index of the corresponding marker on the map.

function showMarkerDescriptnion(index)
{
     LISTENERS370[index]['Ng'].call();
}

Hope this helps out someone else who is attempting to display the infowindow of a marker in the DNN map module from outside of the map module itself.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsMapMapDisplay marker descriptionDisplay marker description


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out