MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Black ring around added shapes

This is a discussion on Black ring around added shapes within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello, Can anyone tell me why I get the black ring around the shape? My code is below. I first ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  4 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-07-2008
Junior Member
White Belt
 
Join Date: Jun 2008
Posts: 10
Black ring around added shapes

Hello,

Can anyone tell me why I get the black ring around the shape? My code is below. I first execute the function called in command button1. I then execute the sub called in command button 2. This causes a big black ring to surround the shapes. Why...and how do I get rid of it?

Thanks,
Bart

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''''''
This section is in the form: frmmain which has the mappoint 2006 control(MappointControl1) and 3 buttons

Private Sub Form_Load()
MappointControl1.NewMap geoMapNorthAmerica
FillTestArray
End Sub

Private Sub Command1_Click()
AddSomeShapesandLocations
End Sub


Private Sub Command2_Click()
PlaceSingleNewShape 45.5008, -122.5943, vbBlue
End Sub


Private Sub Command3_Click()
DeleteSingleNewShape
End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''



' This section is in a VB5 module

Private busy As Boolean

' objects used by Function AddSomeShapesandLocations
Private objMap As MapPointCtl.Map
Private objLoc(1 To 100) As MapPointCtl.Location


Private objMapx As MapPointCtl.Map
Private objLocx(1 To 100) As MapPointCtl.Location

Private arrayA(1 To 100) As latlon

Type latlon
lat As Single
lon As Single
End Type

Sub FillTestArray()

Dim i As Integer

For i = 1 To 100
arrayA(i).lat = 45.5006
arrayA(i).lon = -122.5942
Next

End Sub


Function AddSomeShapesandLocations()

If busy = True Then Exit Function

busy = True
' example code


Dim k As Integer
Dim loclat As Single
Dim loclon As Single


Set objMap = frmmain.MappointControl1.ActiveMap

' specify locations based on array data
For k = 1 To 100
loclat = arrayA(k).lat
loclon = arrayA(k).lon
Set objLoc(k) = objMap.GetLocation(loclat, loclon, 5)
Next


' set view location to center of data
Set objMap.Location = objLoc(50)

' plot circles at the locations
For k = 1 To 100
objMap.Shapes.AddShape geoShapeOval, objLoc(k), 0.1, 0.1
objMap.Shapes.Item(k).Line.ForeColor = vbRed
objMap.Shapes.Item(k).Line.Weight = 1
objMap.Shapes.Item(k).Fill.ForeColor = vbRed
objMap.Shapes.Item(k).Fill.Visible = True
objMap.Shapes.Item(k).ZOrder geoSendToBack

Next

busy = False

MsgBox "Done"

End Function

Sub PlaceSingleNewShape(lat As Single, lon As Single, color As Long)

If busy = True Then Exit Sub

busy = True

Set objMapx = frmmain.MappointControl1.ActiveMap
Set objLocx(1) = objMapx.GetLocation(lat, lon, alt)

' draw circle
objMapx.Shapes.AddShape geoShapeOval, objLocx(1), .4, .4

' define shape parameters
objMapx.Shapes.Item(1).Line.ForeColor = color
objMapx.Shapes.Item(1).Line.Weight = 5
objMapx.Shapes.Item(1).Line.Visible = True

objMapx.Shapes.Item(1).Fill.ForeColor = color
objMapx.Shapes.Item(1).Fill.Visible = True
objMapx.Shapes.Item(1).Width = 0.4
objMapx.Shapes.Item(1).Height = 0.4

busy = False

End Sub

Sub DeleteSingleNewShape()

On Error GoTo eh

objMapx.Shapes.Item(1).Delete

Exit Sub

eh:

End Sub
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 07-10-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: Black ring around added shapes

Hi,

You use Line.Weight = 5 witch is very heavy. Can you try with 1 or so just to test? I'm not sure what you mean by the big black ring. Can you eventually attach a picture that we can see the problem ?
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 07-10-2008
Junior Member
White Belt
 
Join Date: Jun 2008
Posts: 10
Re: Black ring around added shapes

Wilfried,

Thanks for the response. I have solved the "problem". I was initially adding say 99 shapes based on 99 defined locations. If I then added a 100th shape at a 100th location all was fine, but when I attempted to delete the 100th shape the ring would appear. I was using an index of 100 to delete the shape. However I found that if I instead used an index of 1 the ring did not appear. If I then move shape and location 100 to another position(after the shape being deleted) the shape is again shown correctly and again, I need to use index 1 to delete it. I guess the delete is based on a "most recent" basis which is a bit counter intuitive.

Again, thanks for your help and suggestions,
Bart
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 07-17-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: Black ring around added shapes

Hi,

Yes, the help say: The name of the shape, or an integer representing the index number of the shape within the collection, ordered from back to front.

So I think with saying "from back to front", they mean the last one first.
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/black-ring-around-added-shapes-8000.html

Posted By For Type Date
Reverse Geocoding with MapPoint 2002 - MapPoint Articles - MP2K Magazine This thread Refback 07-08-2008 02:40 AM
Reverse Geocoding, Another Method - MapPoint Articles - MP2K Magazine This thread Refback 07-08-2008 02:38 AM
Reverse Geocoding, Pt. III - MapPoint Articles - MP2K Magazine This thread Refback 07-08-2008 02:37 AM
More on reverse geocoding, MapPoint on MSDN, and contest round-up - MP2K Update Archives - MP2K Magazine This thread Refback 07-08-2008 02:35 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
MP2006: Territories Hide Black Border Rubinho MapPoint 2006/2009 Discussion 1 11-27-2006 07:35 AM
How to access to an array of pushpins that were added ? Jaba MapPoint 2006/2009 Discussion 4 01-13-2005 06:20 AM
How do you delete an Autoshape after you have added it? Alex Chow MapPoint 2006/2009 Discussion 2 12-09-2003 03:19 PM
I added 14 new pushpin icons to the available ico.... Anonymous MapPoint 2006/2009 Discussion 1 05-17-2002 12:23 PM
Using MP2002 I've added some pushpins to a map via.... Anonymous MapPoint 2006/2009 Discussion 1 07-18-2001 01:01 PM


All times are GMT -5. The time now is 06:06 AM.


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

Luxury Ski Holidays
Whether you are looking for luxury ski holidays or something simpler visit Holiday Hypermarket to compare prices. Getting value for your money is easy when you use us.

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

Holidays Jamaica
Holidays to Jamaica are a great way to immerse yourself in a different culture. Soak up some sun, indulge in some shopping, and relax at a beach resort. Use dealchecker.co.uk.

Holidays in Cyprus
Holidays in Cyprus are enriched by the abundance of churches, ruins and natural wonders. Book a holiday with us today!

Morocco
Gain insight on your holiday destination with the ULookUBook travel guides. Find out about Morocco and its customs online. Make an informed decision when you make a booking.

Travel In
Travel.co.uk is the one you are looking for when checking out price comparison sites, so that you can travel in the way you choose.

Cheap Lanzarote Holidays
The Canary Islands beckons you to come! View information on cheap Lanzarote holidays 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