MapWindow 4 - ActiveX Control Programming : MapWindow Discussion Forum
I have opened different layers on my map.Now i want to draw a text box on the map to write something for information on it.How can i draw it.Currently i am taking snapshot of the map and copying that tmp.jpeg file in MSWord and then drawing a textbox on that image.How can i draw the text box at run
how to draw text box on the map
Posted by: preetisingh ()
Date: December 08, 2011 03:47AM

I have opened different layers on my map.Now i want to draw a text box on the map to write something for information on it.How can i draw it.Currently i am taking snapshot of the map and copying that tmp.jpeg file in MSWord and then drawing a textbox on that image.How can i draw the text box at runtime.Please help.

Options: ReplyQuote
Re: how to draw text box on the map
Posted by: pmeems ()
Date: December 08, 2011 06:50AM

The ocx is just a control and you can add another control (textbox) to it.
You can look at Microsoft's site for more info.

--
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

Options: ReplyQuote
Re: how to draw text box on the map
Posted by: preetisingh ()
Date: December 21, 2011 02:13AM

I have searched on microsoft's site and as i want to add the text box at runtime i got the help also .It can be done by "Controls.Add". But again there is a problem... I draw a point on the map and then i want to put a text box to show the lat,long of that point.This all has to be done at run time.By using the following coding i am able to draw the text box only on the form not on the map control.

Dim txt as textbox
Dim tn as double
Dim x1 as double
Dim y1 as double
Dim latitude as double
Dim longitude as double
latitude =val(form7.txtlatitude.text)
longitude =val(form7.txtlongitude.text)
Map1.ProjToPixel longitude,latitude,x1,y1
Set txt = Controls.Add("VB.textbox","txt" & tn & " ",Form2)
txt.Move x1,y1,1200,350
txt.visible=True
txt.text=" "
tn=tn+1
end sub


If i replace the line
Set txt = Controls.Add("VB.textbox","txt" & tn & " ",Form2)
by the line
Set txt = Controls.Add("VB.textbox","txt" & tn & " ",Form2.Map1)

i got the following error "Map is not a valid Control container."


I just want to label the lat/long on the map at run time.Is there any other method. Or tell me where i am wrong.

Options: ReplyQuote
Re: how to draw text box on the map
Posted by: pmeems ()
Date: December 22, 2011 02:58AM

If you want to add text on the map you should use the label methods.
First add the lat and long values as an attribute (field) to your shapefile.
Next set up labels and you have your text.

--
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

Options: ReplyQuote
Re: how to draw text box on the map
Posted by: preetisingh ()
Date: December 23, 2011 01:58AM

Thanks for your hint.I have used AddDrawingLabel and now i can label lat/long.But a small problem is there.If two points are closer to each other then the label of the one point hides the label of the other.How to make it transparent so that the label of the other could be visible.Please tell.

Options: ReplyQuote
Re: how to draw text box on the map
Posted by: pmeems ()
Date: December 23, 2011 02:22AM

You need to look at the collision parameters.
By default it is set to not overlap labels.
I think it is a property op the map object:
map1.Collision (or something)

--
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

Options: ReplyQuote


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: