MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Pushpins in current view

This is a discussion on Pushpins in current view within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello, Is there an easy way to get all the pushpins in the current map view? (Mappoint 2004) Now I ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  11 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 11-02-2007
Junior Member
White Belt
 
Join Date: Nov 2007
Posts: 4
Pushpins in current view

Hello,

Is there an easy way to get all the pushpins in the current map view? (Mappoint 2004)

Now I have the following solution:

MapPoint.Location[] locations = new MapPoint.Location[5];
locations[0] = myMap.XYToLocation(myMap.Left, myMap.Top);
locations[2] = myMap.XYToLocation(myMap.Left, myMap.Height);
locations[4] = myMap.XYToLocation(myMap.Width, myMap.Height);
locations[6] = myMap.XYToLocation(myMap.Width, myMap.Top);
locations[8] = myMap.XYToLocation(myMap.Left, myMap.Top);

and then a do a QueryPolygon on my dataset.

Is there another (better/easier) way to do this?

Thanks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 11-02-2007
Member
Yellow Belt
 
Join Date: Feb 2005
Posts: 48
Cool Re: Pushpins in current view

Not sure if you are are working in vb6 or what lang.

Or with Dataset

but perhaps the following will help bring further insight:

The useful bit I found in a similar pursuit was the QueryAllRecords

I've got some other non-relevant info here (some might say more than less !) just ignore that though.

'For each pushpin, output the lat/lon and symbol lines.
For Each objDataSet In m_objMap.DataSets
Set objRecordset = objDataSet.QueryAllRecords
objRecordset.MoveFirst
Do Until objRecordset.EOF
CalcPos m_objMap, objRecordset.Pushpin.Location, dblLat, dblLon
m_colMIFLines.Add "Point " & CStr(Round(dblLon, 6)) & " " & CStr(Round(dblLat, 6)) & vbCrLf
m_colMIFLines.Add " Symbol (44,13395711,10)" & vbCrLf
strnote = ""
'Add information in the balloon and note fields to the data to be written.
For Each objField In objRecordset.Fields
If objField.VisibleInBalloon Then
strnote = strnote & objField.Name & ": " & CStr(objField.Value) & "> "
End If
Next
If Len(strnote) >= 2 Then
strnote = left$(strnote, (Len(strnote) - 2))
End If
If objRecordset.Pushpin.Note <> "" Then
strnote = strnote & IIf(strnote <> "", "> Note: ", "") & objRecordset.Pushpin.Note
End If

'Add a data line to the mid file, including the pushpin data and symbol.
m_colMIDLines.Add Chr$(34) & objRecordset.Pushpin.Name & Chr$(34) & "," & CStr(m_lObjectCount) & "," & objRecordset.Pushpin.Symbol & ",0," & Chr$(34) & left$(strnote, 255) & Chr$(34) & vbCrLf

'Update the object count.
' frmSpatialDataImport.lblRecordCount.Caption = "Shape Count: " & m_lObjectCount
DoEvents
m_lObjectCount = m_lObjectCount + 1
objRecordset.MoveNext
Loop
Next


Tim Miltz

Last edited by tfmiltz; 11-02-2007 at 03:47 AM. Reason: didn't sign
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 11-02-2007
Junior Member
White Belt
 
Join Date: Nov 2007
Posts: 4
Re: Pushpins in current view

Thanks for your reply.
I am working in C# .Net.
To explain further, my goal is to get only the PushPins visible in the current view.
I have a MapPoint dataset containing al the puspins that are placed on the map. Now I want a subset of this dataset containing only that pushpins that are visible in the current view of the map.

E. van Dijk
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 11-02-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: Pushpins in current view

Hi,

Then calculate lat/long of the 4 corners of the map in view and you can easy calculate wht is in view or not
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/pushpins-current-view-6676.html

Posted By For Type Date
A More Compact Method for Obtaining Lat/Long - MapPoint Articles - MP2K Magazine This thread Refback 11-07-2007 03:15 AM
Pushpin Tool Add-in - MP2K Magazine This thread Refback 11-07-2007 03:14 AM
Apple Blog » Blog Archive » Pushpins in current view This thread Pingback 11-05-2007 04:57 PM
Excel User-Defined Functions and MapPoint - MapPoint Articles - MP2K Magazine This thread Refback 11-05-2007 09:13 AM
Create 3D Map Video - Win a Free Zune from Microsoft - MapPoint News - MP2K Magazine This thread Refback 11-05-2007 06:48 AM
Merging Multiple Routes - MapPoint Articles - MP2K Magazine This thread Refback 11-04-2007 04:16 PM
MapPoint Help - MP2K Magazine This thread Refback 11-02-2007 09:50 AM
Programming MapPoint via .NET - MapPoint Articles - MP2K Magazine This thread Refback 11-02-2007 07:37 AM
Automating MapPoint in C++ With Built In GPS Features Enabled - MapPoint Articles - MP2K Magazine This thread Refback 11-02-2007 07:30 AM
Determing Whether A Point Is Located Inside Polygon - MapPoint Articles - MP2K Magazine This thread Refback 11-02-2007 07:27 AM
About MP2Kmag - MP2K Magazine This thread Refback 11-02-2007 06:26 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Stop Users from Deleting or Cutting Pushpins from map view Yazzy MapPoint 2006/2009 Discussion 1 05-26-2005 02:56 PM
Saving current view of map radiusdude MapPoint 2006/2009 Discussion 2 04-05-2005 07:36 AM
Getting current GPS coordinates in VB6 Anonymous MapPoint 2006/2009 Discussion 2 06-10-2004 05:09 PM
get longitude/latidude of current view programmaticly Anonymous MapPoint 2006/2009 Discussion 0 03-10-2004 04:45 PM
Is it possible to expand upon the current 255 push.... Anonymous MapPoint 2006/2009 Discussion 1 04-16-2002 09:32 PM


All times are GMT -5. The time now is 02:36 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Exeter Flights
Visit Holiday Hypermarket online to find all the essential information about Exeter Airport and Exeter flights. Booking is quick, easy and cheap with Holiday Hypermarket.

Flights to Spain
Find and book flights to Spain. Travel Counsellors can help with travel to Spain including flights and accommodation.

Cape Town Flight
Book a Cape Town Flight for great value when you book through dealchecker.co.uk. It doesn't take long to find the latest great deals for you.

Holidays in Dubai
Holidays in Dubai are an eclectic mix of the ancient and the modern. Discover an oasis of luxury amid the Arabian desert. Book here now!

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.

All inclusive holiday
Travel.co.uk is a travel comparison service which makes it easy to search and find your all inclusive holiday.

Holidays in Florida
Take a break! Enjoy stunning coastline! Info on holidays in Florida available at On The Beach!


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51