Community of MapPoint and Bing Maps Users and Developers
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 ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Black ring around added shapes 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 |
| |||
| 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 ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz www.comfortsoftware.be www.expertsoftware.be MapPoint coding demo |
| |||
| 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 |
| |||
| 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.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz www.comfortsoftware.be www.expertsoftware.be MapPoint coding demo |
![]() |
| Tags |
| added, black, ring, shapes |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |