Community of VE/MapPoint Users and Developers
This is a discussion on How do I use AddPolyline method in Delphi within the Development forums, part of the MapPoint 2006/2009 Discussion category; Can anyone give me some code that shows how to use the AddPolyline method to the shapes collection in Delphi. ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| var VertexList: TStringList; LocationArray: array of variant; begin SetLength(LocationArray, VertexList.Count); for i := 0 to VertexList.Count - 1 do begin LocationArray[i] := oMap.GetLocation(Piece(VertexList[i],',', 1), Piece(VertexList[i], ',', 2)); end; oMap.Shapes.AddPolyline(VarArrayRef(LocationArray) ); This does actually draw the polyline but I get an access violation in oleaut32.dll. This seems to be when the procedure ends. I can only think this is something to do with the array being freed. |
| |||
| Re: How do I use AddPolyline method in Delphi
Hi, If it is because the array being freed you can try to put it as a private member in your class instead of on the stack frame as you do now. Please let us know if this works. If not then please post the complete procedure. Oh yes and please put code into [ code ] tags. Then it shows up with the right indent and is much better to read
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi I tried moving the variable to a private member of my form but it made no difference which implied that wasn't the actual problem. I have now found a solution that works by making my LocationArray variable a variant and then using the VarArrayCreate function to create my array and then just passing my LocationArray variable to the AddPolyline method. |
| |||
|
Hi According to the help file in order to make the polyline closed you need to create an extra vertex which is the same as the first one which is fine. However, how do I know if freeform shapes drawn on the map are closed since the vertices property just contains the different points, i.e. when a polyline is closed it doesn't contain an extra vertex for the start point and there isn't a property that tells you if it is closed. Stephen |
| |||
| Re: How do I use AddPolyline method in Delphi
Hi, I don't think you can see in the code if it is visually closed.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| ||||
| Posted By | For | Type | Date | |
| MapPoint Articles - MP2K Magazine | This thread | Refback | 09-10-2007 10:31 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Addpolyline from a dataset | micheln | MapPoint 2006/2009 Discussion | 3 | 05-04-2007 06:49 AM |
| AddPolyLine (s) array problem | FreddyD | MapPoint 2006/2009 Discussion | 1 | 12-20-2006 12:45 PM |
| Shapes.AddPolyline is very slow | tdaffin | MapPoint 2006/2009 Discussion | 4 | 01-27-2006 07:08 AM |
| Addpolyline , Array , Visual Basic and Other languages | Anonymous | MapPoint 2006/2009 Discussion | 2 | 08-26-2004 03:58 AM |
| addpolyline | Anonymous | Wish List | 2 | 04-25-2003 03:50 PM |
Ski Holidays Austria
Ski holidays in Austria offer ski schools for all types of skiers. They range from beginner classes of all ages to more advanced classes. Learn new techniques and refresh skills.
European City Breaks
Book European city breaks with Travel Counsellors. A personal travel counselor will help plan your European city break.
Cheap Holidays to Cuba
Cheap holidays to Cuba are a reality when you book with dealchecker.co.uk. We search leading UK Travel agents and tour operators to bring you some great deals.
Dominican Republic Holidays
Dominican Republic holidays have something to offer for everyone. From water sports, to sun bathing and more, enjoy a holiday there!
Spain
Spain is such a diverse country that it has something to offer most holidaymakers. Finding delicious cuisine is no challenge and the shopping ranges from designer boutiques to unknown flea markets. Spain has much to offer.
Travel
Check out the travel options on Travel.co.uk.
Cheap Gran Canaria Holidays
Want to take a break and visit the Canary Islands? Get information on cheap Gran Canaria holidays at On The Beach.