locked
window.ero.setBoundingArea in v5 RRS feed

  • Question

  • Trying to incorporate dynamic content for a shape's popup window.  In version 4, this was the way you could get a reference to the default popup div.

     

    Code Snippet

    window.ero.setBoundingArea(

    new Microsoft.Web.Geometry.Point(0,0),

    new Microsoft.Web.Geometry.Point(document.body.clientWidth, document.body.clientHeight + 600));

    alert(2);

    window.ero.setContent("<div id='" + DivID + "'>Loading...</div>");

    window.ero.dockToElement(e);

     

    Is this still the correct way to do this in version 5?  As when I run this script, I never get to the alert(2); line.  Doesn't error out, justnothing happens.

    Thursday, May 3, 2007 3:42 AM

Answers

  • After digging through the virtual earth forums and SDK, I haven't found an answer yet.  Here is the solution that I think will work.  I overload the onmouseover event like so

     

    Code Snippet

     

    map.AttachEvent("onmouseover", PinHover);

     

    GetPinData();

     

    Then the GetPinData() function is executed as before except I don't set the Descripton or Title with the PinID like before

    Code Snippet

    function OnMapDataSucceeded(results, eventArgs)

    {

    //decode pins

    var result=results.split(",")

    var locs = decodeLine(result[0]);

    //clear existing pins

    pins = new Array();

    map.DeleteAllPushpins();

    pinID = 0;

    //put data into memory

    for(x = 0; x < locs.length; x++)

    {

    pins.push(new clusteredPin(locs[x],result[x+1]));

    AddPin(x, locs[x])

    }

     

    //helper to add a VE pin.

    function AddPin(pinID, latlon)

    {

    //we use the details field to store the pin ID.

    var shape = new VEShape(VEShapeType.Pushpin, latlon);

    shape.SetCustomIcon("/images/icon12.png");

    map.AddShape(shape);

    }

     

    The PinHover() method is then called whenever I hover over a push pin .  Except now, instead of retrieving the push pin ID from the Title or Description of the push pin , I parse the element ID because the push pin ID is actually in the elementID highlighted in blue msftve_1000_200002_10032_I.  This elimates the issue of overwriting the push pin ID when you do the setTitle() or setDescription() method as described in my previous post.  So I retrieve the push pin ID from there via the following code.  Therefore eliminating the need for the window.ero.SetBoundingArea() method.

    Code Snippet

    // on pin hover

    function PinHover(e)

    {

    //make sure we are over a shape

    if (e.elementID != null)

    {

    //split the elementID

    var elementID_array=e.elementID.split("_");

    //get the shapeID from the elementID

    var shapeID = elementID_array[0] + "_" + elementID_array[1] + "_" + elementID_array[2];

    //get the pinID from the elementID

    var pinID = Right(elementID_array[2], 5);

    //get a reference to the shape

    var shape = map.GetShapeByID(shapeID);

    //Trim the leading zero's fromthe pinID

    var ID = TrimString(pinID)

    var DivID = PopupPrefix + ID;

    shape.SetTitle("<div id='" + DivID + "_Title'>Store</div>");

    shape.SetDescription("<div id='" + DivID + "_Desc'>Getting Information...</div>");

    getAJAXContent(ID, pins[ID].bounds,0);

    }

    }

     

    Then in the getAJAXContent function I pull the pushpin detail from the web service and then set the content of the <div>'s .

    Code Snippet

    //Receive content for popup

    function OnContentSucceeded(result, ID)

    {

    //verify this is the data for the current popup.

    if (ID==CurrentPopupID)

    {

    //set the title

    $get(PopupPrefix + ID + "_Title").innerHTML = "<span style='font-size: 9pt; font-weight: bold;'>Store #" + result.StoreID + "</span>";

    //set the content

    $get(PopupPrefix + ID + "_Desc").innerHTML = "<table style='border: 0px; font-size: 7pt; margin: 0px; padding: 0px;'>" +

    "<tr>" +

    "<td style='padding-right: 5px;'>" + result.Address + "<br>" + result.City + ", " + result.State + " " + result.Zip + "<br><br>Ph. (" + result.AreaCode + ")" + result.Phone + "</td>" +

    "<td><img src=123.jpg' alt='' border='0'></td>" +

    "</tr>" +

    "<tr>" +

    "<td colspan='2' style='text-align: left;'><a href='#' onclick='getStoreDetail(\"" + result.StoreID + "\");' style='text-decoration: underline;'>more info</a></td>" +

    "</tr>" +

    "</table>";

    }

    }

     

     

    This is what I think will work as a way to get content on Demand with Virtual Earth version 5 since I have seen lots of questions about it but no answers yet.  If anyone see's some issues with the way this works or has a easier/better way PLEASE let me know!

    Thursday, May 10, 2007 3:27 AM

All replies

  • Seems as though Microsoft has renamed their variables in V5, and this hack isn't supported but if you really need to directly convert try to see if this works:

    Code Snippet

    window.ero.setBoundingArea(

    new Msn.VE.Geometry.Point(0,0);

    new Msn.VE.Geometry.Point(document.body.clientWidth, document.body.clientHeight + 600));

    alert(2);

    window.ero.setContent("<div id='" + DivID + "'>Loading...</div>");

    window.ero.dockToElement(e);

     
    Regards,

    Thursday, May 3, 2007 4:05 PM
  • Thanks for the reply!

     

    That doesn't seem to be working, or I am doing something else wrong.

     

    I have overriden the map onmouseover event  using

    Code Snippet
    map.AttachEvent(
    "onmouseover", PinHover);

     

     

    which calls this function

    Code Snippet

    // on pin hover

    function PinHover(e)

    {

    //make sure we are over a shape

    if (e.elementID != null)

    {

    //we stored the pin ID in the Title field

    var shape = map.GetShapeByID(e.elementID);

    var ID = shape.GetTitle();

    var DivID = PopupPrefix + ID;

    //create the default VE popup with loading text.

    window.ero.setBoundingArea(

    new Msn.VE.Geometry.Point(0,0),

    new Msn.VE.Geometry.Point(document.body.clientWidth, document.body.clientHeight + 600));

    window.ero.setContent("<div id='" + DivID + "'>Loading...</div>");

    window.ero.dockToElement(e);

    //get the content for the pin.

    alert(1);

    //shape.SetDescription("<div id='" + DivID + "'>Getting Information...</div>");

    getAJAXContent(ID, pins[ID].bounds,0);

    return false;

    }

    }

     

     I never get to the alert(1) though... am I missing something?

    Monday, May 7, 2007 8:09 PM
  • Perhaps its this line:

    Code Snippet
    var shape = map.GetShapeByID(e.elementID);

     

    As I think this won't work because you need to truncate the last few digits and the last underscore in the ID.  If you alert this and compare to the actual ShapeID, you'll notice the ShapeID is shorter (and I think its the correct ID) to pass into the GetShapeByID method.

    Also to note:

    Code Snippet
     

    window.ero.setBoundingArea(

    new Msn.VE.Geometry.Point(0,0),

    new Msn.VE.Geometry.Point(document.body.clientWidth, document.body.clientHeight + 600));

     

    I threw the above into an html file, loaded with no problems.  Likely its the code before this that is failing somewhere along the line

    I'd have to see your entire source code to debug it properly though.
    Monday, May 7, 2007 10:27 PM
  • You were right on the Shape ID as the e.elementID was msftve_1000_200002_10032_I  and the ShapeID was actually msftve_1000_200002.

     

    But after using the the ShapeID in this line

    Code Snippet

    window.ero.dockToElement(shapeID);

     

    Stil no luck.

     

    Here is a brief overview of what I am attempting to make sure I am not missing something simple.

     

    Here I call the load the map and attach the mouse over event.  And call the GetPinData() method.

    Code Snippet

    map.AttachEvent("onmouseover", PinHover);

    //get the data for the default view

    GetPinData();

     

    The GetPinData() method connects to a web service and on a successful retrieval of data calls the following function which then adds the the points to the map.

    Code Snippet

    //callback when data returns from web service

    function OnMapDataSucceeded(results, eventArgs)

    {

    //decode pins

    var result=results.split(",")

    var locs = decodeLine(result[0]);

    //clear existing pins

    pins = new Array();

    map.DeleteAllPushpins();

    pinID = 0;

    //put data into memory

    for(x = 0; x < locs.length; x++)

    {

    pins.push(new clusteredPin(locs[x],result[x+1]));

    AddPin(x, locs[x])

    }

     

    //helper to add a VE pin.

    function AddPin(pinID, latlon)

    {

    //we use the details field to store the pin ID.

    var shape = new VEShape(VEShapeType.Pushpin, latlon);

    shape.SetCustomIcon("/images/icon12.png");

    shape.SetTitle("");

    shape.SetDescription(pinID + "");

    map.AddShape(shape);

    }

     

     

    Then comes my onmouseover function which is causing the trouble

    Code Snippet

    // on pin hover

    function PinHover(e)

    {

    //make sure we are over a shape

    if (e.elementID != null)

    {

    //split the elementID

    var elementID_array=e.elementID.split("_");

     

    //get the shapeID from the elementID

    var shapeID = elementID_array[0] + "_" + elementID_array[1] + "_" + elementID_array[2];

     

    //get a reference to the shape

    var shape = map.GetShapeByID(shapeID);

    var ID = shape.GetDescription();

    var DivID = PopupPrefix + ID;

     

    //create the default VE popup with loading text.

    window.ero.setBoundingArea(

    new Msn.VE.Geometry.Point(0,0),

    new Msn.VE.Geometry.Point(document.body.clientWidth, document.body.clientHeight + 600));

    window.ero.setContent("<div id='" + DivID + "'>Getting Information...</div>");

    window.ero.dockToElement(shapeID);

    alert(2);

    //shape.SetDescription("<div id='" + DivID + "'>Getting Information...</div>");

    getAJAXContent(ID, pins[ID].bounds,0);

    return true;

    }

    }

     

    What happens is I never see the alert(2);  I tried not using the window.ero.setBoundingArea() method, and use the commented out shape.SetDescription method.  This worked fine if I only hover over an icon once. Since my shape description is storing the PinID, when I use the SetDescription to show the loading message, it erases the PinID and as you can guess just blows up from there.

     

    So where am i going wrong?  Is there any easier way?

    Tuesday, May 8, 2007 3:33 AM
  • After digging through the virtual earth forums and SDK, I haven't found an answer yet.  Here is the solution that I think will work.  I overload the onmouseover event like so

     

    Code Snippet

     

    map.AttachEvent("onmouseover", PinHover);

     

    GetPinData();

     

    Then the GetPinData() function is executed as before except I don't set the Descripton or Title with the PinID like before

    Code Snippet

    function OnMapDataSucceeded(results, eventArgs)

    {

    //decode pins

    var result=results.split(",")

    var locs = decodeLine(result[0]);

    //clear existing pins

    pins = new Array();

    map.DeleteAllPushpins();

    pinID = 0;

    //put data into memory

    for(x = 0; x < locs.length; x++)

    {

    pins.push(new clusteredPin(locs[x],result[x+1]));

    AddPin(x, locs[x])

    }

     

    //helper to add a VE pin.

    function AddPin(pinID, latlon)

    {

    //we use the details field to store the pin ID.

    var shape = new VEShape(VEShapeType.Pushpin, latlon);

    shape.SetCustomIcon("/images/icon12.png");

    map.AddShape(shape);

    }

     

    The PinHover() method is then called whenever I hover over a push pin .  Except now, instead of retrieving the push pin ID from the Title or Description of the push pin , I parse the element ID because the push pin ID is actually in the elementID highlighted in blue msftve_1000_200002_10032_I.  This elimates the issue of overwriting the push pin ID when you do the setTitle() or setDescription() method as described in my previous post.  So I retrieve the push pin ID from there via the following code.  Therefore eliminating the need for the window.ero.SetBoundingArea() method.

    Code Snippet

    // on pin hover

    function PinHover(e)

    {

    //make sure we are over a shape

    if (e.elementID != null)

    {

    //split the elementID

    var elementID_array=e.elementID.split("_");

    //get the shapeID from the elementID

    var shapeID = elementID_array[0] + "_" + elementID_array[1] + "_" + elementID_array[2];

    //get the pinID from the elementID

    var pinID = Right(elementID_array[2], 5);

    //get a reference to the shape

    var shape = map.GetShapeByID(shapeID);

    //Trim the leading zero's fromthe pinID

    var ID = TrimString(pinID)

    var DivID = PopupPrefix + ID;

    shape.SetTitle("<div id='" + DivID + "_Title'>Store</div>");

    shape.SetDescription("<div id='" + DivID + "_Desc'>Getting Information...</div>");

    getAJAXContent(ID, pins[ID].bounds,0);

    }

    }

     

    Then in the getAJAXContent function I pull the pushpin detail from the web service and then set the content of the <div>'s .

    Code Snippet

    //Receive content for popup

    function OnContentSucceeded(result, ID)

    {

    //verify this is the data for the current popup.

    if (ID==CurrentPopupID)

    {

    //set the title

    $get(PopupPrefix + ID + "_Title").innerHTML = "<span style='font-size: 9pt; font-weight: bold;'>Store #" + result.StoreID + "</span>";

    //set the content

    $get(PopupPrefix + ID + "_Desc").innerHTML = "<table style='border: 0px; font-size: 7pt; margin: 0px; padding: 0px;'>" +

    "<tr>" +

    "<td style='padding-right: 5px;'>" + result.Address + "<br>" + result.City + ", " + result.State + " " + result.Zip + "<br><br>Ph. (" + result.AreaCode + ")" + result.Phone + "</td>" +

    "<td><img src=123.jpg' alt='' border='0'></td>" +

    "</tr>" +

    "<tr>" +

    "<td colspan='2' style='text-align: left;'><a href='#' onclick='getStoreDetail(\"" + result.StoreID + "\");' style='text-decoration: underline;'>more info</a></td>" +

    "</tr>" +

    "</table>";

    }

    }

     

     

    This is what I think will work as a way to get content on Demand with Virtual Earth version 5 since I have seen lots of questions about it but no answers yet.  If anyone see's some issues with the way this works or has a easier/better way PLEASE let me know!

    Thursday, May 10, 2007 3:27 AM
  • I think i Have found a flaw in the way this is working.  When you change the zoom level, the ID's get messed up and after that this quits working

    getAJAXContent(ID, pins[ID].bounds,0);

    Friday, May 11, 2007 2:58 PM
  • Have you found a solution?  I too have a similiar issue.
    Thursday, May 17, 2007 7:40 PM
  • I did find a way to make my situation work.  I will try and get some code up to explain what I did.
    Monday, May 21, 2007 12:10 AM
  • I am very interested in your solution, as I am trying to implement clustering using VE v5. Thanks in advance.
    Monday, May 21, 2007 8:08 PM
  • Here is a summary of how I updated the clustering technique provided by SoulSoultions to version 5.  I am sure there is a better way to do this, but I needed to get it done for a client ASAP, so this is what I came up with.

     

    First set the map controls

    Code Snippet

    //setup map over United States
        map = new VEMap('Map');   
        map.LoadMap(new VELatLong(41, -99), 4 ,'h' , false);
        map.SetScaleBarDistanceUnit(VEDistanceUnit.Miles);
        //turn off the standard popup and attach our custom handler
        map.AttachEvent("onmouseover", PinHover);
        //get the data for the default view
        GetPinData();

     

    Here is the GetPindData() function

    Code Snippet

    function GetPinData()
    {   
        //encode the current map bounds
        var points = new Array();
        var pixel;
       
        pixel = new VEPixel(0, 0);
        points.push(map.PixelToLatLong(pixel));
       
        pixel = new VEPixel(mWidth, mHeight);
        points.push(map.PixelToLatLong(pixel));
       
        var bounds = createEncodings(points);

        //get zoomlevel
        var zoom = map.GetZoomLevel();
       
        //encode the current map bounds
        var points = new Array();
        var pixel;
       
        pixel = new VEPixel(0, 0);
        points.push(map.PixelToLatLong(pixel));
       
        pixel = new VEPixel(mWidth, mHeight);
        points.push(map.PixelToLatLong(pixel));
       
        var bounds = createEncodings(points);

        //get zoomlevel
        var zoom = map.GetZoomLevel();
       
        //call webservice to get Current Stores
        VirtualEarthAjax.MapService.GetClusteredMapData(bounds, zoom, OnMapDataSucceeded, OnFailed);  
    }

     

    Code Snippet
    //callback when data returns from web service
    function OnMapDataSucceeded(results, eventArgs, StoreType)
    {
        //decode pins
        var result=results.split(",");
        var locs = decodeLine(result[0]);
       
        //clear existing pins
        Pins = new Array();
        map.DeleteAllPushpins();
        pinID = 0;
       
        //put data into memory
        for(x = 0; x < locs.length; x++)
        {
             Pins.push(new clusteredPin(locs[x],result[x+1]));
             AddPin(x, locs[x]);
        }
    }

     

     

    Here is where I started running into issuess with version 5 as described in my previous posts.  So what I did was store the pinID in the Title within a <span> tag with the visibility set to hidden.

    Code Snippet

    //helper to add a VE pin.
    function AddPin(pinID, latlon)
    {
        var shape = new VEShape(VEShapeType.Pushpin, latlon);        
        shape.SetCustomIcon("images/Heart12.png");
        shape.SetTitle("<span style='visibility: hidden;'>" + pinID + "</span>");           
        map.AddShape(shape);
    }  

     

     

    Then on the mouseover PinHover() function I get a reference to the shape the mouse is over.  And strip off the <span> tag and get the pinID.  Then I reset the Title with the pinID and the description with the loading message.

    Code Snippet

    // on pin hover  
    function PinHover(e)
    {
        //make sure we are over a shape
        if (e.elementID != null)
        {  
            //get a reference to the shape
            var shape = map.GetShapeByID(e.elementID);
           
            //get the shape ID
            var shapeID = shape.GetID();
            
            //get the pinID from the title
            var pinID = StripPinID(shape.GetTitle());
           

            var DivID = PopupPrefix + pinID;

            //create the default VE popup with loading text.
            shape.SetTitle("<span id='" + DivID + "_Title' style='visibility: hidden;'>" + pinID + "</span>");
            shape.SetDescription("<div id='" + DivID + "_Desc'>Getting Information...</div>");
            
            getAJAXContent(pinID, currentStorePins[pinID].bounds, 0);
         }
    }

     

     

    Code Snippet

    //request content for popup
    function getAJAXContent(ID, bounds, startIndex)
    {
        //store the current pin ID to validate what popup for what data
        CurrentPopupID=ID;
        //call the web service
        VirtualEarthAjax.MapService.GetPushPin(bounds, startIndex, OnContentSucceeded_, OnFailed, ID);
    }

     

     

    then on the content succeeded function I reference the to <span> tags and set their HTML with my content from the webservice.

    Code Snippet

    //Receive content for popup
    function OnContentSucceeded(result, ID)
    {
        //verify this is the data for the current popup.
        if (ID==CurrentPopupID)
        {
           //set the title
           $get(PopupPrefix + ID + "_Title").innerHTML = result.Title;
           
           //set the content      
           $get(PopupPrefix + ID + "_Desc").innerHTML = result.Content;
                            
        }
    }

     

    I hope this helps.  I think I got everything in there and didn't miss any functions.  If I did please let me know!  If you see a better way to improve upon this also please let me know!  The only issue I have ran upon is sometimes the onmouseover function will get called multiple times in a row when I hover over a pin.  When this happens the pin gets stuck on the "Getting Information...." display.  But if i move my mouse off of it and then back on it works again.  Haven't had a chance to really debug this and figure out what is going on. 

     

     

    Tuesday, May 22, 2007 3:11 AM
  • Thanks! very helpful.

    Tuesday, May 22, 2007 12:40 PM
  • Hi,

     

    This code works for me.

     

    I'm using Internet Explorer 6 SP1. My intention is to show you how to have both effects:

     

    - have a V5 (!) reference to the map control: <script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script>

     

    - set the the content of the pushpin info box on demand by using the old OnMouseOverCallback V4 technique, when pushpins are 'VEPushPin' and not the new 'VEShape'.

     

    //Credit for the original code goes to:

    //http://www.soulsolutions.com.au/Articles/PopupContentonDemand/tabid/98/Default.aspx

    //http://www.soulsolutions.com.au/onclick.html

    //http://www.viavirtualearth.com/MyVirtualEarth/v3/dynamicpushpin.htm

     

    <html>

    <head>

    <title>V4 style pushpins but V5 Earth Map Control SDK</title>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <script src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5'></script>

    <script type="text/javascript">

    var map = null;

    var pinID = 0;

    var dashBoardSizes = new Array(VEDashboardSize.Normal,VEDashboardSize.Small,VEDashboardSize.Tiny) ;

    //I'd also like to assign this user defined object to the pushpin

    var myObject=new Object();

    myObject.x= "Hello";

    myObject.y= 123;

    var clicked=false;

    function GetMap()

    {

    var latitude = 42.098;

    var longitude = -102.216;

    var zoomLevel=4;

    map = new VEMap('myMap');

    map.SetDashboardSize(dashBoardSizes[0] );

    map.LoadMap(new VELatLong(latitude, longitude), zoomLevel ,'r' ,false,VEMapMode.Mode2D,false);

     

    AddPushpinStyleV4(new VELatLong(latitude, longitude),null,"V4 style pushpin","Click the pushpin. The user defined data is preserved after moving the map");

    AddPushpinStyleV4(new VELatLong(latitude-2, longitude-2),null,"V4 style pushpin","Click the pushpin. The user defined data is preserved after moving the map");

     

    map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers) ;

    }

    function AddPushpinStyleV4(location, icon_url, title, details)

    {

    pinID++;

    //old V4 style pushpin

    var pin = new VEPushpin(pinID, location, icon_url, String(pinID), details);

    //set  the info box to load its content on demand

    VEPushpin.ShowDetailOnMouseOver = false;

    VEPushpin.OnMouseOverCallback = OnMouseOverV4;

    map.AddPushpin(pin);

    var element = document.getElementById(pinID);

    if (element)

    {

    //assign the 'onclick' event handler and the 'user defined object' to the pushpin

    element.onclick = OnMouseClickV4;

    element.data = myObject;

    }

    else

    {

    alert(" V4 style VEPushpin, can't retrieve the DOM element ");

    }

    }

    function OnMouseOverV4(x, y, title, details)

    {

    try

    {

    if (clicked)

    {

    // alert('your mouse is at : ' + x + ', ' + y + "\r\n"+

    // 'title: ' + unescape(title) + "\r\n"+

    // 'details: ' + unescape(details));

    var ID = title;

    var DivID = "VPOP" + ID;

    var e=document.getElementById(ID+"_"+map.GUID);

    if (e!=null &&e!="undefined")

    {

    window.ero.setBoundingArea(

    new Msn.VE.Geometry.Point(0,0),

    new Msn.VE.Geometry.Point(document.body.clientWidth,

    document.body.clientHeight));

     

    window.ero.setContent("<div class='VE_Pushpin_Popup_Title' id='" + DivID + "'>Loading...</div>");

    window.ero.dockToElement(e);

    getAJAXContent(ID,DivID);

    }

    }

    }

    catch(ex)

    {

    alert ("OnMouseOverV4() exception: '"+ex.message+"'");

    }

    }

    function getAJAXContent(ID,DivID)

    {

    try

    {

    var result;

    //this element has the pushpin's user defined data!

    var pushpinID = window.event.srcElement.id.split("_", 1);

    var element =document.getElementById(pushpinID);

    if (element)

    {

    result ="<div class='VE_Pushpin_Popup_Title' >"+ ID +"</div>" ;

    result+="<div class='VE_Pushpin_Popup_Body'>"+

               "V4 pushpin<br> ID ="+window.event.srcElement.id+"<br>"

            "User defined data is ("+element.data.x+","+element.data.y+")"+"</div>";

    }

    else

    {

    result ="V4 pushpin, can't get the pushpin's DOM element ";

    }

    var resultDiv = document.getElementById(DivID);

    if (resultDiv!=null && resultDiv!="undefined")

    {

    resultDiv.innerHTML = result;

    }

    }

    catch(ex)

    {

    alert ("getAJAXContent() exception: '"+ex.message+"'");

    }

    }

    function OnMouseClickV4()

    {

    try

    {

    clicked=true;

    document.getElementById(window.event.srcElement.id).onmouseover();

    clicked=false;

    }

    catch(ex)

    {

    alert ("OnMouseClickV4() exception: '"+ex.message+"'");

    }

    }

    function DeletePushPinV4(aPin)

    {

    try

    {

    if (aPin!=null)

    {

    map.DeletePushpin(aPin);

    }

    else

    {

    map.DeleteAllPushpins();

    }

    }

    catch (ex)

    {

    alert(ex.message);

    }

    }

    function OnLoadPage()

    {

    GetMap();

    }

    function OnUnloadPage()

    {

    DisposeMap();

    }

    function DisposeMap()

    {

    if (map != null)

    {

    // DeletePushPinV4();

    map.Dispose();

    map=null;

    }

    }

    </script>

    </head>

    <body onload="OnLoadPage();" onunload="OnUnloadPage();">

    <div id='myMap' style="position: relative; width: 600px; height: 600px; left: 72px;

    top: 8px; z-index: 100;">

    </div>

    <div id="popup" style="z-index: 101; left: 752px; width: 100px; position: absolute;

    top: 480px; height: 100px">

    </div>

    <div style="z-index: 102; left: 264px; width: 320px; position: absolute; top: 632px;

    height: 24px; color: purple;">

    Click the pushpins to see the custom info box</div>

    </body>

    </html>

    Tuesday, May 29, 2007 7:40 AM
  • Dear jkuhlz,

    I have two questions regarding your post.

    1) Is there any other way to pass the <div > tag to the page other than through [shape.Title] and [shape.Description]. We are basically looking for a placeholder for our custom content right?

    2)
    Code Snippet
    //get the pinID from the title
            var pinID = StripPinID(shape.GetTitle());

    Where is the StripPinID function?


    Thank you,

    -G
    Monday, October 6, 2008 5:59 PM