Community of VE/MapPoint Users and Developers
This is a discussion on Vertices and VB.Net within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; hi, i'm trying to use Vertices of shape drawen by user for later use. The problem is that i cant ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Vertices and VB.Net i'm trying to use Vertices of shape drawen by user for later use. The problem is that i cant get the vertices content. here is a sample of my code: Me.MPCtl.NewMap(MapPoint.GeoMapRegion.geoMapNorthA merica) Dim iShape As MapPoint.Shape iShape = Me.MPCtl.ActiveMap.Shapes.Item(1) Dim MyMap As MapPoint.Map MyMap = Me.MPCtl.ActiveMap Dim MyLoc() As MapPoint.Location MyLoc = CType(iShape.Vertices, MapPoint.Location()) (i'm using VB.Net with an activeX of MapPoint) now, the last line is doing my headache... the compiler saids it cant do the casting... BUT vertices is a collection of locations, isn't it ? another by the way question is - why do i need to do all those castings every where ? (i mean when using findresults, etc.) - i cant (dont want to) put the option explicit off ... thaks a lot, alon |
| |||
| Vertices with C#
Hi. To use Vertices, you must be a expert in casting... This is a sample in C# but you can try to convert this code. I use this code to find distance between a Location object and Vertices (from AddDrivetimeZone method) double dblMaxDistance = 0; foreach(object obj in ((object[])objShape.Vertices)) { double dblDistance = ((MapPoint.Location)obj).DistanceTo(objLoc); if (dblDistance > dblMaxDistance) dblMaxDistance = dblDistance; } I hope this code help you. |
| |||
| Vertices - Thanks...
hi "Guest", well it doesnt require an expert !! and it sure did help !!! thank you !!!! anyway, didnt thought to cast to an object, after all the vertices are an array of locations... As i looked for a solution for this problem i saw lots of developers stuck on it - your solution is a salvation for a lot of people.... keep on doing what ever you up to, Alon |
![]() |
| Tags |
| vbnet, vertices |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to get the Locations for the 4 vertices of a Square? | cx123 | MapPoint 2006/2009 Discussion | 0 | 10-26-2004 11:01 AM |
| How to determine the length of Shape.vertices in Delphi? | schuchhardp | MapPoint 2006/2009 Discussion | 0 | 12-13-2002 05:45 AM |
| Zip codes or cities vertices or shapes | Claude VERDIER | MapPoint 2006/2009 Discussion | 2 | 09-17-2002 06:21 AM |