PDA

View Full Version : Creating an application with mappoint within vb



blackmap
12-11-2002, 05:19 AM
Hi all!

Am quite new to mappoint and I am trying to programm an application with the active x. What I can already do is to put up am map, zoomto a certain adress etc.

What I am looking now for is:

-How can I add the legend to my app/ control?
-How can I click on a certain pushpin, make an odbc connection and show some information from the odbc database ?
-This is a mappoint user forum, right? Is there a forum just for developers?


Thank you very much!


Peter

John Meyer
12-11-2002, 06:19 PM
You are in the right forum.

To add the legend

MapPointControl1.PaneState = geoPaneLegend

To work with a Pushpin that you have selected.


Dim objmap As MapPointctl.Map
Dim objPushpin As MapPointCtl.Pushpin

Set objmap = MapPointControl1.ActiveMap
'Make sure the item selected on the map is a pushpin
If TypeOf objmap.Selection Is Pushpin Then
Set objPushpin = MapPointControl1.Selection
'Do Something
End If

blackmap
12-16-2002, 07:36 AM
Hi John,

thanks a lot for your answers!

When I paste the last code snipplet into the mouse_down event of the mappoint control it causes a mean crash. Do you have an idea?

What I want to do is:

Click on a pushpin in my map, when it's sapushpin I want to connect to an odbc database and sho some information in a dialog.


Peter

John Meyer
12-16-2002, 06:15 PM
I would put the code in the "SelectionChange event"

At the point in the code sample that says "Do Something" call a subroutine, passing it the pushpin object.

You can not run your code inside the event procedure or you will get the "Server Busy Error"