ThinkGeo.com    |     Documentation    |     Premium Support

How to use the VirtualEarth client API?

Hello,


I would like to use the VirtualEarth client API to GeoCode an address. For this, I would like to use the Find method available on a VEMap instance, like in the attached file.


When I run this page, a get a javascript Exception saying that 'this.m_vemap.vemapcontrol' is null or undefined.


Is there another way to get the VEMapControl instance created in MapSuite and OpenLayers, and to use the Find method?


Thank you


Nicolas



186-TestVirtualEarthGeoCoding.zip (2.18 KB)

Nicolas, 


As VE map has been created, you do not need to create it again; instead, you can find it by the following code:
var veMap = Map1.GetOpenLayersMap().getLayersByName("VirtualEarth Aerial")[0].loadMapObject();
 
Please have a look at the attached code for detail.
 
 
Ben

188-Post4977.zip (6.65 KB)