Reputation: 10422
I can't seem to get Bing to accept my API key from my dev server-- I've set up an API key from the bingmapsportal.com site, and set the URL to http://localhost
and generated the key successfully.
I then implement the map as shown in the API docs, as follows:
<html>
<head>
<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
<script type="text/javascript">
function getMap(){
var mapInitOpts = {
credentials: 'mycredentials',
mapTypeId: Microsoft.Maps.MapTypeId.road
};
var map = new Microsoft.Maps.Map(document.getElementById("map_canvas"), mapInitOpts);
}
</script>
</head>
<body onload="getMap();">
<div id='map_canvas' style="position:absolute; top:0px; left:0px; width:100%; height:100%;"></div><br />
</body>
</html>
// map shows invalid credentials error
However, I always get the "Specified credentials invalid" message.
Any ideas on this issue?
Upvotes: 4
Views: 7521
Reputation: 5789
Assuming you had 'mycredentials'
act as a place holder for your actual credentials for this question posting, try using the API key from the interactive SDK:
AjtUzWJBHlI3Ma_Ke6Qv2fGRXEs0ua5hUQi54ECwfXTiWsitll4AkETZDihjcfeI
If the above works, and the key you obtained doesn't, then something is wrong with your key and you need to work with Bing Dev Support.
If the above key doesn't work, then there is something wrong with your development environment...
Upvotes: 5