MapPoint in VB.Net - add pushpin to map

Posted on 2010-11-11
Last Modified: 2012-05-10
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

Question by:LD147
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 18

Accepted Solution

lludden earned 500 total points
ID: 34113371
Your code works fine for me.  What version of Mappoint and VS are you using?  I tested with Vs2010 and MP2010.

        Dim oPushPin As MapPoint.Pushpin
        Dim oMap As MapPoint.Map
        oMap = GetObject(, "MapPoint.Application").ActiveMap
        oPushPin = oMap.AddPushpin(oMap.FindResults("1600 Pennsylvania Ave, washington dc")(1), "test") ' set pushpin to the current customer street address
        oPushPin.BalloonState = GeoBalloonState.geoDisplayBalloon


Author Comment

ID: 34114063
I am using VS2010 Ultimate and MP2010 America.  I tried your code....same thing.  No pushpin.  Weird....

Author Comment

ID: 34114773
I uninstalled MapPoint and reinstalled - the pushpins now appear on the map.  LOL.

Author Comment

ID: 34114787
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 :)

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with exporting to excel 4 44
Import MySQL data into MS Access using VB.Net interface 5 48
MYSQL responding very slow 3 48
Get sourcecode path 14 46
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below.…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question