Link to home
Start Free TrialLog in
Avatar of LD147
LD147Flag 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

ASKER CERTIFIED SOLUTION
Avatar of lludden
lludden
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LD147

ASKER

I am using VS2010 Ultimate and MP2010 America.  I tried your code....same thing.  No pushpin.  Weird....
Avatar of LD147

ASKER

I uninstalled MapPoint and reinstalled - the pushpins now appear on the map.  LOL.
Avatar of LD147

ASKER

Even though your code didn't really fix my problem, I appreciate the help :)  It turns out, I guess, that a setting, or something got corrupted somewhere.  The reinstall fixed it :)