I create Microsoft bing map. JavaScript run time error('Microsoft' is undefined) come up When it is loading.
function GetMap() {
var vcredentials = "<%=this.credentialKey%>" //credential Key
var vlatitude = Number("<%=this.latitude%>") //Latitude
var vlongitiude = Number("<%=this.longitiude%>") //Longitude
var vzoomLevel = Number("<%=this.zoom%>"); //Zoom Level
var isDataAvailable = "<%=this.isFound%>"; //Is data available
// Create the Map instance
map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), //div map load
{
credentials: vcredentials, //credential
center: new Microsoft.Maps.Location(vlatitude, vlongitiude),// Latitude and Longitude
mapTypeId: Microsoft.Maps.MapTypeId.road, //bing map type
zoom: vzoomLevel, //zoom level
showBreadcrumb: true, // show Bread crumb
enableSearchLogo: false,//enable Search Logo
enableClickableLogo: false,//enable Clickable Logo
customizeOverlays: true //customize Overlays
});
if(isDataAvailable == "True" || isDataAvailable == "true")
AddPushPin();
Microsoft.Maps.Events.addHandler(map, 'viewchange', OnViewChanged);
Microsoft.Maps.Events.addHandler(map, 'click', OnMouseClicked);
}