Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MapPoint in VB.Net - add pushpin to map

Posted on 2010-11-11
4
Medium Priority
?
1,398 Views
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

0
Comment
Question by:LD147
[X]
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
4 Comments
 
LVL 18

Accepted Solution

by:
lludden earned 2000 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
        oPushPin.Location.GoTo()


0
 
LVL 1

Author Comment

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

Author Comment

by:LD147
ID: 34114773
I uninstalled MapPoint and reinstalled - the pushpins now appear on the map.  LOL.
0
 
LVL 1

Author Comment

by:LD147
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 :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

610 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