locked
Two maps with registerModule? RRS feed

  • Question

  • Does Bing Maps v7 support two maps on the same web page?  If yes, does it also support using the same module on both maps?  When I register the module, how do I support both maps?

    Microsoft.Maps.registerModule("PointBasedClusteringModule", "*.js");

    -=Dan=-

    Saturday, June 23, 2012 12:20 AM

Answers

  • You can often use the same module on two maps but not always, it depends on how the module was designed. The Point based clustering module can work with multiple maps as you have to create a new instance of the module when you load it for each map. For example, here is how you would create two instances of this module.

     myLayer = new PointBasedClusteredEntityCollection(map, {
    	                    singlePinCallback: createPin,
    	                    clusteredPinCallback: createClusteredPin
    	                });
    
     myLayer2 = new PointBasedClusteredEntityCollection(map2, {
    	                    singlePinCallback: createPin,
    	                    clusteredPinCallback: createClusteredPin
    	                });


    http://rbrundritt.wordpress.com

    Monday, June 25, 2012 8:31 AM