MapWindow 4 - ActiveX Control Programming : MapWindow Discussion Forum
I draw a point on the map and added it in the lvLegend.Now i want that if the lvLegend item (i.e. the point) is checked, the point should be displayed and if it is not checked it should disappear.Again if i check it, it should appear again.I have used the following code for it but the problem is th
To again show the point drawn.
Posted by:
preetisingh ()
Date: December 20, 2011 03:00AM
I draw a point on the map and added it in the lvLegend.Now i want that if the lvLegend item (i.e. the point) is checked, the point should be displayed and if it is not checked it should disappear.Again if i check it, it should appear again.I have used the following code for it but the problem is that once it is disappearing it not coming again when i check it again.The code follows:-
I am not getting how to redraw the point or make it invisible when the item is unchecked. Please tell...
[Edit: ] Added the code tags for better reading
Edited 1 time(s). Last edit at 12/20/2011 08:58AM by pmeems.
Private Sub lvLegend_ItemCheck(By val Item as MSComctlLib.ListItem)
Dim i as long
For i=1 to Form10.lvLegend.ListItems.Count
hDraw=Form10.lvLegend.ListItems(i).Tag
If(Form10.lvLegend.ListItems(i).Checked=True) Then
Form2.Map1.Redraw
Else
Form2.Map1.ClearDrawing(hDraw)
Endif
Next
End Sub
I am not getting how to redraw the point or make it invisible when the item is unchecked. Please tell...
[Edit: ] Added the code tags for better reading
Edited 1 time(s). Last edit at 12/20/2011 08:58AM by pmeems.
Re: To again show the point drawn.
Posted by:
pmeems ()
Date: December 20, 2011 09:03AM
What you are doing with ClearDrawing() is clearing the drawing layer. Meaning it has no features on it anymore.
If you want to show the point you need to add them again.
Redraw() means the layer is redrawn from the buffer, but your buffer is empty ;)
You can also have a look at the visible property of the layer. I don't remember if you can hide drawing layers but you can try: Map1.Layers(hDraw).Visible = False (or something like it).
--
Paul
--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn
If you want to show the point you need to add them again.
Redraw() means the layer is redrawn from the buffer, but your buffer is empty ;)
You can also have a look at the visible property of the layer. I don't remember if you can hide drawing layers but you can try: Map1.Layers(hDraw).Visible = False (or something like it).
--
Paul
--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn
Re: To again show the point drawn.
Posted by:
preetisingh ()
Date: December 21, 2011 02:29AM
I have a confusion.In my project i have made command button to open different layers of the map.It is working perfectly.Now i open another form that displays two text boxes one is for latitude and other is for longitude.Then there is a command button to draw the point of that particular lat/long.It is also drawn correctly on the map.But my confusion is that,the lat/long drawn are on any of the layers of the map? Because if i remove all the layers of the map the points remain there i.e. they are not attached with the layers of the map.So where are the layers of these points.Please explain.I am using DrawPoint to draw the point.
Re: To again show the point drawn.
Posted by:
sindizzy ()
Date: December 21, 2011 09:22PM
Show your code. usually the layer is a drawinly layer that you create:
hndDraw = NewDrawingLayer(blah, blah)
'draw a point
'draw a circle
I forget the exact synatx but each drawling layer has a handle.
btw, the wiki was very useful for these types of things. what happened to the documentation wiki with small examples?
AGP
hndDraw = NewDrawingLayer(blah, blah)
'draw a point
'draw a circle
I forget the exact synatx but each drawling layer has a handle.
btw, the wiki was very useful for these types of things. what happened to the documentation wiki with small examples?
AGP
Re: To again show the point drawn.
Posted by:
pmeems ()
Date: December 22, 2011 03:08AM
@AGP: The wiki was hacked numerous times so we had to shut it down.
Early next year I'll try to put the export files of the wiki online.
I've got the files a few days ago. These static files will have a lot of info and small examples.
When it is online we'll start making a new wiki on codeplex using the old static wiki as an example. And of course update the info when needed and add info and samples for the new features.
Feel free to help with this task.
--
Paul
--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn
Early next year I'll try to put the export files of the wiki online.
I've got the files a few days ago. These static files will have a lot of info and small examples.
When it is online we'll start making a new wiki on codeplex using the old static wiki as an example. And of course update the info when needed and add info and samples for the new features.
Feel free to help with this task.
--
Paul
--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn
Re: To again show the point drawn.
Posted by:
preetisingh ()
Date: December 25, 2011 07:20AM
Yes there is a handle named hDraw for the point drawn.But when i place the code
If(Form10.lvLegend.ListItems(i).Checked=True) Then
Form2.Map1.Layervisible(hDraw)=True
Else
Form2.Map1.Layervisible(hDraw)=False
Endif
then the layer on the map with the map boundries or something that is showing the map goes visible and invisible, not the layer having the point.just tell me how to refer the handle having that point not of the map.Or how can it be done by using buffer?
If(Form10.lvLegend.ListItems(i).Checked=True) Then
Form2.Map1.Layervisible(hDraw)=True
Else
Form2.Map1.Layervisible(hDraw)=False
Endif
then the layer on the map with the map boundries or something that is showing the map goes visible and invisible, not the layer having the point.just tell me how to refer the handle having that point not of the map.Or how can it be done by using buffer?
Sorry, only registered users may post in this forum.


