Pushpin to Address, rather than Lat/Long
I'm having some massive difficulties in displaying a map with a pushpin set to a specific location. Basically, I have the address information in a database, and would like to show a map to the location with a pushpin.
The second step is get driving directions between two locations in the database, but let's tackle issue #1 first eh
<script src="http://dev.virtualearth.net/mapcontrol/v4/mapcontrol.js"></script>
<script>
var map = null;
var pinID = 1;
function GetMap()
{
map = new VEMap('myMap');
map.LoadMap();
}
map.FindLocation('812 10th Street, Milford, IA');
function AddPin()
{
var pin = new VEPushpin(
pinID,
map.GetCenter(),
null,
'My pushpin',
'This is pushpin number '+pinID
);
map.AddPushpin(pin);
pinID++;
}
</script>
<body onload="GetMap();AddPin();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
The map successfully adds a pushpin to the center of the map, but it is not getting the location I'm giving it.
Thanks in advance,
Matt