MapPoint Forums

MapForums

Community of MapPoint and Bing Maps Users and Developers




Black ring around added shapes

This is a discussion on Black ring around added shapes within the MapPoint Desktop 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 Desktop Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-07-2008
Member
Yellow Belt
 
Join Date: Jun 2008
Posts: 39
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
Location: Belgium
Posts: 2,407
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
Member
Yellow Belt
 
Join Date: Jun 2008
Posts: 39
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
Location: Belgium
Posts: 2,407
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

Tags
added, black, ring, shapes


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 Desktop Discussion 1 11-27-2006 07:35 AM
How to access to an array of pushpins that were added ? Jaba MapPoint Desktop Discussion 4 01-13-2005 06:20 AM
How do you delete an Autoshape after you have added it? Alex Chow MapPoint Desktop Discussion 2 12-09-2003 03:19 PM
I added 14 new pushpin icons to the available ico.... Anonymous MapPoint Desktop Discussion 1 05-17-2002 12:23 PM
Using MP2002 I've added some pushpins to a map via.... Anonymous MapPoint Desktop Discussion 1 07-18-2001 01:01 PM


All times are GMT -5. The time now is 10:56 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.0 RC3
MP2K Magazine
Visitor Map



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