Community of VE/MapPoint Users and Developers
This is a discussion on Layer and Selection Question within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I got two questions for programming with map point 1) is there a way to programmatically change the layer? ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Layer and Selection Question I got two questions for programming with map point 1) is there a way to programmatically change the layer? i'm using map point 2006 and i'm trying to make a button click that will change the layer from "Road Map" -> "Road and Data Map" and back 2) is there a way to tell if a "drawn object" (like a drawn rectangle) is selected? my program has a "delete" button, but it is only used to delete drawn objects. so i was hoping to have the delete button disabled if nothing was selected and enabled if something was selected. thank so much |
| |||
| Re: Layer and Selection Question
Hi, You can use SelectionChange event for yoiu second question. As for you first question, there is no layers in mappoint.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Layer and Selection Question
Oh! To change the map style, it's Quote:
I also used axMappointControl.ActiveMap.Selection to let me know if something was selected or not. However, I'm not able to tell if the selection is a drawn object (which I want) or a selection of a label (City, State, landmark, etc...) Last edited by Kevin_Williams; 12-05-2006 at 06:26 PM. Reason: Found the answer |
| |||
| Re: Layer and Selection Question
Hi, You can check if the NewSelection argument is a Direction, Location, Pushpin, Shape, or Waypoint object. In your case you can take acton when it is a Shape object.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Layer and Selection Question
Sorry I have to ask this, but how to get get to the NewSelection argument? I'm not sure what to call get the type of the selected object axMappointControl.ActiveMap.Selection only gives me a System.__ComObject |
| |||
| Re: Layer and Selection Question
Hi, No problem. What is the programming language you do it ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Layer and Selection Question
I'm using C# This is what I have so far (it's not much) Quote:
Last edited by Kevin_Williams; 12-07-2006 at 02:43 PM. Reason: trying to get the code snippet to display correctly |
| |||
| Re: Layer and Selection Question
Hi, Code: Shape shape = e.pNewSelection as Shape
if (shape == null)
return;
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Layer and Selection Question
Thanks Wilfried The snippet worked I have the following: Code: private void axMappointControl_SelectionChange(object sender, AxMapPoint._IMappointCtrlEvents_SelectionChangeEvent e)
{
MapPoint.Shape shape = e.pNewSelection as MapPoint.Shape;
if (shape == null)
{
// disable control
}
else
{
// enable control
}
} |
![]() |
| Tags |
| layer, question, selection |
| ||||
| Posted By | For | Type | Date | |
| MapPoint Download - MP2K Magazine | This thread | Refback | 12-06-2006 07:52 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| multi-layer data mapping | Anonymous | Wish List | 4 | 08-10-2004 03:51 PM |
| layer problem [urgent] | Joeba | MapPoint 2006/2009 Discussion | 3 | 10-16-2003 10:11 AM |
| Adding a layer/image over a City | Anonymous | MapPoint 2006/2009 Discussion | 2 | 11-22-2002 02:25 PM |
| specify label to all the objects of a layer | Anonymous | Wish List | 0 | 08-28-2002 08:22 AM |
| Is there any way to refresh just one PushPin Layer.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 07-27-2001 10:29 AM |