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

Visual Basic.NET

Avatar of undefined
Last Comment
LD147

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
lludden

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
LD147

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

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

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 :)
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy