Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 2 of 2

Active-X : Way to determine if pushpin is on diplayed map?

This is a discussion on Active-X : Way to determine if pushpin is on diplayed map? within the MapPoint Desktop Discussion forums, part of the Map Forums category; I'm fairly new to the MP 2004 Active-X control for VS.NET 2003, so forgive me if this is a basic ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Active-X : Way to determine if pushpin is on diplayed map?

    I'm fairly new to the MP 2004 Active-X control for VS.NET 2003, so forgive me if this is a basic question.

    I'm populating pushpins on a territory map to represent a technician's stops for the day. My default altitude is 30 miles, and sometimes a pushpin falls outside the map if the stop is out of the way.

    Is there any way to determine if a new pushpin is going to fall outside the viewable map area, so I can increase the map object's altitude?

    Thanks in advance,

    Andre Ranieri

  2. #2
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    This sample is in VB6 but I'm sure you will be able to get the idea. 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 your worried about.

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to determine territory of a recently placed pushpin ?
    By Sonicman_ in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 09-16-2006, 10:34 AM
  2. Determine if Map has been closed
    By BirdIslander in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-07-2005, 02:33 PM
  3. Determine if a shape is behind roads?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-30-2005, 11:15 AM
  4. Determine if a polyline is closed?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 03-29-2005, 12:37 PM
  5. Is there a way to determine the minimum distance b....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-22-2002, 05:45 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96