Avatar of LD147
LD147
Flag for United States of America

asked on 

MapPoint in VB.Net - add pushpin to map

I really hate MapPoint!  :)  I have an address in a variable named 'address' which looks like this (Street, City, State, Zip).  I'm trying to add a Push Pin to the map, with this address, but to no avail.  I always have problems programming MapPoint.  

Here's the code I have.  I get no errors.  However, no push pins appear on the map.  TIA.
AxMappointControl1.NewMap(MapPoint.GeoMapRegion.geoMapNorthAmerica) ' start new map

' ***
' address (variable) is defined here...figured you didn't need to see the code for that, and placed into a variable named 'address'
' ***

           ' plot this address onto the map
            Dim oPushPin As MapPoint.Pushpin
            Dim oMap As MapPoint.Map
            oMap = GetObject(, "MapPoint.Application").ActiveMap
            oPushPin = oMap.AddPushpin(oMap.FindResults(address)(1), "some text here") ' set pushpin to the current customer street address
            oPushPin.Location.GoTo() ' zoom in on last pushpin drawn

Open in new window

Visual Basic.NET

Avatar of undefined
Last Comment
LD147

8/22/2022 - Mon