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=""></script>
var map = null;
var pinID = 1;

function GetMap()
map = new VEMap('myMap');
map.FindLocation('812 10th Street, Milford, IA');
function AddPin()
var pin = new VEPushpin(
'My pushpin',
'This is pushpin number '+pinID

<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,

Re: Pushpin to Address, rather than Lat/Long

Derek Chan

Hmm I wonder how come people are having problems with doubling posting.... Anyways I've answered this one in the other duplicate post

Re: Pushpin to Address, rather than Lat/Long

Kartik Subramani

Hey matt,

you need to put the FindLocation call inside your AddPin function, before you create the new VEPushpin. That way your map will first center on the location, and then add the pushpin. Right now that FindLocation call won't ever be executed.


Re: Pushpin to Address, rather than Lat/Long


Or, FindLocation can be given a callback function, which takes a single argument for the results (lat lng object) and you can add the pushpin within that function.

SDK has a lot about this so I would look there.