none
Problem due to action link created inside infobox due to generic code of bing map RRS feed

  • Question

  • We are creating the infobox on bing map with few actions.Adding the action incorporates calling bing function with title and event handler as its parameters .We no where require the action to be rendered as link but Bing maps renders these action on map as list of actions with hyper link tag(a) with href as #(<a href="#" >title</a>).The code we are using is mentioned below .

     

     InfoBoxActions.push({
                      label : '<div class="abc" style="'
                         + actionButtonWidth +'"><img class="Image" src="'
                         + xxx.Constants.imgPath
                         + 'add-place.png"/></div>',
                   eventHandler : function(e) {
                      selfMainControllerObj.showCreatePlaces({fullAddress : locDataAddress.streetaddr + "," +
                         locDataAddress.city + "," + locDataAddress.state});
                      e.stopPropagation();
                   }
                });
             }

             var infobox = new Microsoft.Maps.Infobox(
                   anchorPoint,
                   {
                      description : info,
                      actions : InfoBoxActions,
                      visible : false,
                      showCloseButton : xxx.Constants.MAP.INFOBOX.ADDRESS.CLOSE_BUTTON,
                      height : xxx.Constants.MAP.INFOBOX.ADDRESS.HEIGHT,
                      width : xxx.Constants.MAP.INFOBOX.ADDRESS.WIDTH,
                      offset : new Microsoft.Maps.Point(
                            xxx.Constants.MAP.INFOBOX.ADDRESS.OFFSET_X,
                            xxx.Constants.MAP.INFOBOX.ADDRESS.OFFSET_Y),
                      zIndex : 50,
                      showPointer : false
                   });

    As per the requirement for our application (javascript base) of which Bing map implementation is a part , we are managing the browser history. Problem on our end is that if we click on these action, url is appended with a blank "#" . As we are maintaining  the history using "# Url"  only this creates a gap in the action history.

    Is there any method to avoid creating hyper link tag(a) for actions ?  We just want it simply to be rendered as a div or span but not as anchor tag or if We can provide a proper 'href' for the same link from our side.

    This is a real trouble We are facing and blocking our further functionality with bing maps.Please help me to find some workaround for this.

    • Moved by Ricky_Brundritt Saturday, March 10, 2012 10:15 AM (From:Bing Maps: Map Control and Web services Development)
    Tuesday, August 2, 2011 7:13 AM

Answers

  • When using the built-in infobox, all of the text is wrapped within an anchor tag. The only way around this is to create your own customized infobox. This method also lets you customize it more than the built-in one allows.
    Tuesday, August 2, 2011 3:41 PM

All replies

  • When using the built-in infobox, all of the text is wrapped within an anchor tag. The only way around this is to create your own customized infobox. This method also lets you customize it more than the built-in one allows.
    Tuesday, August 2, 2011 3:41 PM
  • You can call
    e.preventDefault()
    inside your event handler... that will prevent the default <a href="#"> navigation.

    Craig Hutchison Software Engineer Experient, Inc.


    Monday, September 19, 2016 3:18 PM