Hi everyone,
When I add or move a pushpin, is there any way to tell if it's in the visible area of the map?
This is a discussion on ensure pushpin is visible within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi everyone, When I add or move a pushpin, is there any way to tell if it's in the visible ...
Hi everyone,
When I add or move a pushpin, is there any way to tell if it's in the visible area of the map?
Hope this will get you going in the right direction (ok, its a pun) I'm just counting the number of pushpins visible but you could use this to test the pushpin names compared to the name of the pushpin you just added.
Code:'Query number of pushpins visible on screen Dim objmap As MapPointctl.Map Set objmap = MappointControl1.ActiveMap Dim objDataSet As MapPointctl.DataSet Dim objRecords As MapPointctl.Recordset Dim objLocs(1 To 5) As MapPointctl.Location Set objLocs(1) = objmap.XYToLocation(objmap.Left, objmap.Top) Set objLocs(2) = objmap.XYToLocation(objmap.Width, objmap.Top) Set objLocs(3) = objmap.XYToLocation(objmap.Width, objmap.Height) Set objLocs(4) = objmap.XYToLocation(objmap.Left, objmap.Height) Set objLocs(5) = objmap.XYToLocation(objmap.Left, objmap.Top) lngCount = 0 For Each objDataSet In objmap.DataSets Set objRecords = objDataSet.QueryPolygon(objLocs) objRecords.MoveFirst Do While Not objRecords.EOF lngCount = lngCount + 1 objRecords.MoveNext Loop Next MsgBox "Number of records in polygon: " & lngCount
John
http://www.support-pc.com
Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Thanks John,
I'll try and get my head round that.
Chris
There are currently 1 users browsing this thread. (0 members and 1 guests)