Multiple map issue

Jul 14, 2015 at 9:02 AM
If I have 2 maps on the page, then I only get 1 circle drawn. I have a function that is passed the div ID and the data. The function then sets the Microsoft.Maps.Map(document.getElementById(divForMap) etc and does the locations. All works fine. Both maps have all the locations plotted with pins etc. It's just the circle that only shows on the 2nd map.

The only way I can get a circle to appear on each map is if I have 2 versions of the javascript file with different names and to duplicate my function.

So I have bingCircle.js and bingCircle2.js.
bingCircle.js has Microsoft.Maps.moduleLoaded('CircleModule'); at the bottom and bingCircle2.js has Microsoft.Maps.moduleLoaded('CircleModule2');


//Register and load the Circle Module
Microsoft.Maps.registerModule("CircleModule", "/static/staticNM/scripts/bingCircle.js");
Microsoft.Maps.loadModule("CircleModule", {...
//Register and load the Circle Module
Microsoft.Maps.registerModule("CircleModule2", "/static/staticNM/scripts/bingCircle2.js");
Microsoft.Maps.loadModule("CircleModule2", {...
Any ideas on what I need to do to get the circle to work correctly with 2 maps without having to duplicate the javascript?