Community of VE/MapPoint Users and Developers
This is a discussion on How to access to an array of pushpins that were added ? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi I have an application that : 1- displays a map 2- retrieves coordinates from a remote application 3- add ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| How to access to an array of pushpins that were added ? I have an application that : 1- displays a map 2- retrieves coordinates from a remote application 3- add these coordinates on a map as pushpins I would like to know if there's a way to access to these pushpins with an array ? I need to show the label of a selected pushpin only and I need to access to an array of all the pushpins that were added to the map... Is that possible ? |
| ||||
|
Yes, they're stored as "pushpin sets". You can have multiple pushpinsets, but you have probably added your pushpins to the default "My Pushpins". This in turn is a "Recordset". If you look up "Recordset" in the help it will show you how to access them. Eg. to get the names of the pushpins in VB6, I have the following code: Code: ' pushpinset, dsidx is an index that is passed in
' you could query oMap.DataSets until you find the required pushpinset
Dim oDS As MapPoint.DataSets
Set oDS = oMap.DataSets
Dim thisDS As MapPoint.DataSet
Set thisDS = oDS.Item(dsidx)
' loop over each pushpin, saving the name
Dim oRS As MapPoint.Recordset
Set oRS = thisDS.QueryAllRecords()
Dim n As Long
n = thisDS.RecordCount
ReDim SrcNameArray(n) As String
oRS.MoveFirst
Dim ii As Integer
ii = 0
Do While Not oRS.EOF
ii = ii + 1
Set pp = oRS.Pushpin
SrcNameArray(ii) = pp.Name
oRS.MoveNext
Loop
The above is an extra of a program I have - I've taken out some extra code to keep things simple and easier to understand what is happening. Combined with the help that comes with MapPoint, it should get you going! Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
|
Thank you... But I work in C#... Anyway I've found an alternative but very specific to my code (using ID in a listbox...) so posting the source wouldn't be helpful for anyone... Anyway your source could help me because I work on many projects Thanks!!! |
| |||
| Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
I won't post the code because there are many parts... and these are very specific to my source code... But I can describe how to do : The purpose is to add pushpins on a map and access them individually without using datasets 1- Add many pushpins on the control with AddPushpin() function 1b- For each added pushpin, add a value in a listbox 1c- The value in the listbox must be unique and must also be assigned to the PushPin.Name property 2- When the user need to find a pushpin, he must click on a value in the listbox and then we search for the clicked pushpin by FindPushpin(ClickedValueInList) function Thats'all folks |
![]() |
| Tags |
| access, added, array, pushpins |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Filtering pushpins..Updating MapPoint by Microsoft Access | Rodde | MapPoint 2006/2009 Discussion | 4 | 11-18-2005 04:22 AM |
| UpdateLink / PushPins / Access DB / HELP!!! | SeanMcGinty | MapPoint 2006/2009 Discussion | 0 | 12-13-2004 05:31 PM |
| Access Pushpins | johnnyo | MapPoint 2006/2009 Discussion | 4 | 01-08-2004 06:15 AM |
| Adding pushpins and viewing map from access project | Dazzer | MapPoint 2006/2009 Discussion | 2 | 11-07-2003 05:09 AM |
| Using MP2002 I've added some pushpins to a map via.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 07-18-2001 01:01 PM |
Cheap Skiing
When it comes to cheap skiing, Holiday Hypermarket will speed you on your way. Searching the leading travel brands, Holiday Hypermarket offers you great value skiing.
Italy Holidays
Find and book Italy Holidays with Travel Counsellors. Holiday destinations around the world including Italy.
Holiday in Turkey
A Holiday in Turkey is great value when you book with dealchecker.co.uk. There is an abundance of things to see and do. Check out the well-preserved Greco-Roman ruins.
Cancun Holidays
Cancun holidays offer beautiful scenery, calm waters and plenty of shopping. Get a taste of the good life while on holiday in Cancun.
Cheap Cyprus Holidays
Finding cheap Cyprus holidays can be difficult unless you know where to look and where to book. With ulookubook.com you can conduct a simple search to find the latest holiday deals to your particular destination.
Comparison Holidays
Travel.co.uk is a travel comparison service which makes it easy for you to find and plan the best holidays.
Holidays to Portugal
Want to take your family on a summer holiday? Visit On The Beach for more information on holidays to Portugal.