How to get Default Right Click context menu in V8 web control RRS feed

  • Question

  • When I right click on either Bing maps or Google maps I get useful  information like the address etc of the location.

    In my app the right click functionality is gone.  How can I get the default context menu back?  Seems silly to try to recreate the default context menu when it already exists.  I do NOT want to recreate this from scratch.

    The app is an upgrade from the Mappoint program.  Customer Geolocation, Routing, Sequencing etc

    Thanks for any info pointing to the solution

    See below for my answer to this problem.  Now you can expand on it.

    inside the GetMap function

                Microsoft.Maps.Events.addHandler(map, 'rightclick', function(e){

    function GetAddress(coordinate) {
                if (!searchManager) {
                    //Create an instance of the search manager and call the geocodeQuery function again.
                    Microsoft.Maps.loadModule('Microsoft.Maps.Search', function () {
                        searchManager = new Microsoft.Maps.Search.SearchManager(map);
                } else {
                    searchManager.reverseGeocode({ location: coordinate.location, callback: ReverseGeocodeCallback });

    • Edited by VFPrules Thursday, February 22, 2018 6:15 PM To help the next person
    Tuesday, January 16, 2018 4:32 PM


All replies

  • The Bing Maps consumer website is basically just another customer of the Bing Maps developer API's and have built a lot of additional functionality which is specific to their website. In this case they created their own context menu. This is not in the Bing Maps API, but you can create one fairly easily, here is a code sample: http://bingmapsv8samples.azurewebsites.net/#Context%20Menu

    [Blog] [twitter] [LinkedIn]

    Tuesday, January 16, 2018 6:02 PM
  • Unfortunately what you are proposing is that I recreate the wheel.  And once this wheel is recreated I should do what everyone else is doing and keep the code to myself.  I prefer to share and let everyone benefit and build upon each other.  Thanks for the effort.
    Tuesday, January 16, 2018 6:31 PM
  • The code sample I provided is part of an open source code sample gallery of Bing Maps examples. You can always make a code sample and add it to the project via a pull request. Here is the project: https://github.com/Microsoft/BingMapsV8CodeSamples

    [Blog] [twitter] [LinkedIn]

    Wednesday, January 17, 2018 1:35 AM