I am calling PointBasedClusteringmodule from a function in custom.js file
GetMap function is called on page load and the code resides in custom.js file.
function GetMap() {
// Initialize the map
map = new Microsoft.Maps.Map(document.getElementById("MapHolder"),
{
credentials: "xxxxxxxxxxxxxxx", zoom: 2,
mapTypeId: Microsoft.Maps.MapTypeId.road, showDashboard: true,
center: new Microsoft.Maps.Location(41.021429, 21.337973)
});
//Nate: 3/26/15: for clustering pushpins
Microsoft.Maps.registerModule("PointBasedClusteringModule", "~/PointBasedClustering.js");
Microsoft.Maps.loadModule("PointBasedClusteringModule", { callback: moduleLoaded });
Microsoft.Maps.Pushpin.prototype.title = null;
Microsoft.Maps.Pushpin.prototype.description = null;
//Getlocations function moved to moduleloaded function
}
The PointBasedClustering.js file as follows. The error is coming after the module is loaded at
Microsoft.Maps.moduleLoaded('PointBasedClusteringModule');
Unhandled exception at line 447, column 1 in http://localhost:52723/Scripts/PointBasedClustering.js
0x800a1391 - JavaScript runtime error: 'Microsoft' is undefined
Any ideas on what is causing this.
Thanks
Nate