Dear support member,
I want to write text drirectly on layer. Is it possible? Basicaly I want to draw a text box on layer, so that a messge can type on selected layer.
Regards
Sanjay
Dear support member,
I want to write text drirectly on layer. Is it possible? Basicaly I want to draw a text box on layer, so that a messge can type on selected layer.
Regards
Sanjay
Sanjay,
Please refer the following code community sample below that is similar to your requirements:
wiki.thinkgeo.com/wiki/File:...110306.zip
The purpose of this sample is to show how to edit the attribute of a feature of a shapefile. This sample is useful for anyone wanting to actualize the attribute part of its data by simply clicking on the desired feature on the map and updating its attribute in a textbox. You will find the editing part of the code in the KeyDown event of the textbox.
This sample is a WPF sample, but I think it is helpful to you and easy to conver to desktop edition one, in this sample you can type the text directly for any selected feature and update ites attribute, you just need to change it to type text direclty for selected overlay on your map.
Any more questions please let me know,
Thanks,
Scott,
Dear Scott,
Thanks for reply,
The above link is WPF sample, I tried to run this sample on my machine, but my system has contains desktop edition, so its not easy to run the sample. After viewing the code, I am not clear about the sample. It will be better if you provide desktop application sample.
I don’t want to change/update any of the attribute, but my simple requirement is typing a messge on any place of layer, where user click mouse and be able to type.
Regards
Sanjay
Sanjay,
I see, maybe I misunderstood anything on your original requirements and the sample is not the same as your requirements. So I need to confirm with you about something below:
You said you want to type a message on any places of layer. Where the user click mouse and type.
I’m not so clear on it, for example, I loaded a ShapeFileFeatureLayer, if the user clicks on any places of the layer, a textbox will pop up so that the user can be able to type any messages?
That’s my understandings, if that, you can do it according to the following steps:
1, Create an new form for the textbox.
2, Write the logic in the WinformsMap_MapClick event, the logic is that the user clicks on the any places of the layer, it will trigger this event and pop up the textbox form. So that the user can type messages.
That’s easy for your requirements I believe you can implement it lightly,
Any more questions please let me know,
Thanks,
Scott,
Dear Scott,
Thanks For reply,
Some part of ruauirement you understand, actually text box will not popup, the requirement like
1. when user click mouse on map layer, there should appear a cursor, like any place where typing available.
2. Now user will type message and completed typing task.
3. Now that text will look like a label, if user wants to move it, they should able to select label and , thay should able to move it accordingly.
This is actual requirement. For reference you can test this requirement in map info.
Regards
Sanjay
Sanjay,
Thanks for your further information, I understand it completely. Currently, we don’t have a easy way to implement your requirements, our development team is working on the AdormentInteractiveOverlay so that the user can be able to add labels to map then select and move it accordingly. This is an new feature for us and we plan to release it in the next public release. Currently, for your requirements we can implement it using the APIs of .NET, please according to my steps below:
1, Create the textbox in the MapClick event, when the user clicks on the map anytime, display the textbox on the clicked location and focus the cursor on the textbox so that the user can type the messages and complete typing.
2, Implement the MouseDown, MouseMove and MouseUp functions for the textbox control, change the textbox’s locations dynamically.
In addition, you mentioned you want a label to display on map so that the user can be able to type any messages, I’m sorry to tell you it is impossible, the label control is read-only, we cannot type any messages at runtime. The textbox is the best control to implement your requirements now.
Any more questions please let me know again,
Thanks,
Scott,
Dear Scott,
Thanks for reply.
I think you understand the requirement, if you want to implement this in next public release, it will be a good feature in map suite.
I know very well that a label is read only control, so its ok for me. So, currently I am not going to implement this feature for my application. But for this reuirement it will better if you look map info and takes reference from there, how they type text on layer, they can also able to save this text in tab file and it is very easy to move anywhere on the map area. This is just my suggestion to take reference and understood full features from there.
Thanks again
Regards
Sanjay
Sanjay,
Thanks for your further information!
Can you give me a link that shows the implementing on map info? If it is possible can you send me some screen shots for that to see if it is a pretty good feature.
Thanks,
Scott,
Dear Scott
Thaks for treply
You can check this with MapInfo 10.5 version application.
Regards
Sanjay
Sanjay,
I just reviewed it and I I think the AdormentInteractiveOverlay can implement it properly, but we are still in development for this new feature, we plan to release it for next public release.
Also if you think any new features are good addition to Map Suite, please feel free to suggest it on our enhancement tracker at:
helpdesk.thinkgeo.com/EnhancementTracker
and see if the Map Suite community will give it any votes.
Thanks,
Scott,