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

Avoided Area?

This is a discussion on Avoided Area? within the MapPoint Desktop Discussion forums, part of the Map Forums category; I'm currently using the following code:- Set objLoc = objMap.SelectedArea.Location If Not objLoc Is Nothing Then If Type Of objLoc ...

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

    Avoided Area?

    I'm currently using the following code:-

    Set objLoc = objMap.SelectedArea.Location
    If Not objLoc Is Nothing Then
    If Type Of objLoc Is Location Then
    Set objShape = objMap.Shapes.AddShape(geoShapeRectangle, objLoc, 5, 5)
    objShape.Avoided = True
    End If
    End If


    This has been bugging me... How can I make the area to be avoided be the exact shape I've actually drawn? At the moment, I'm hard coding a distance of 5 x 5 miles. Surely there must be a simple way to use the Selected Areas distance?

    Thanks

  2. #2
    Martel is offline Junior Member Yellow Belt
    Join Date
    Feb 2003
    Posts
    28

    make avoided area same as selected area

    If you're selecting area on the map and want the avoidance area to be the same size, try storing the selected area height and width before doing anything else. Or am I misreading your question?

    Code:
    Dim selWidth as long
    Dim selHeight as long
    
    selWidth = objMap.SelectedArea.Width
    selHeight = objMap.SelectedArea.Height
    ..
    ..
    
    Set objShape = objMap.Shapes.AddShape(geoShapeRectangle, objLoc, selWidth, selHeight)
    ..
    ..
    fill in the rest of your code then substitute the height and width for your current values.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Selected Area
    By amanuel in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 10-12-2010, 07:55 PM
  2. Surface Area
    By Dazzer in forum MapPoint Desktop Discussion
    Replies: 9
    Last Post: 01-05-2006, 05:13 AM
  3. is an address within an area?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 02-23-2005, 02:51 PM
  4. Mappoint fails calculating the fastest route with avoided zo
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 06-08-2004, 07:27 AM
  5. How to get the 4 map area coordinates ?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-22-2004, 02:44 PM

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