I want to track moving aircrafts in my application. Each aircraft have a label which moves togather with the aircraft. The label should can be selected and dragged to any position.
Also, the label should be multi-line and multi-column and each column's content and stye can be modifed when the aircraft's status changed.
I searched all the samples and not found the solution. May be I can draw text to replace the label?
Following code snippet shows you how to label with more than one column, it is also possible to label it in multiline.
Dim textStyle As New TextStyle() textStyle.TextColumnName = "[NAME1] [NAME2]" textStyle.TextSolidBrush = New GeoSolidBrush(GeoColor.StandardColors.Black) textStyle.Font = New GeoFont(Me.Font.FontFamily.Name, 10)
While I am not quite understand what do you mean by select the label and moves it to any position? Do you want only move the label while keeping the aircraft fixed? Then how you want to selected, I mean select by labeling position or aircraft position?
Just click the label to select it and then drag it to any appropriate position related to the aircraft which is fixed or keeps moving. If the aircraft keeps moving, the label should moves accordingly. Also, I need draw a line to connect the aircraft and its label. You know, if the label is too far from the aircraft, operators may be confused. This function is used to avoid labels overlaping each other.
Further, the selected label should display more information than thats not selected. I mean we have two kinds label for each aircraft, one is standard (only has two columns,for example) and the other is extended (has more columns). Normally the standard one is showed. When the aircraft is selelcted(by clicking on the aircraft) or the label is selected(by clicking on the label), the label changes from standard to extended.
I donot know if the label of Map Suite can do that. If not, can I use drawing-text or any other alternative solution to build costom lables?
First I would like to tell you, if you just want to select and drag a label, currently we don't support that better, we just support the drag ability for point, area, line with labels now. The attachment is the sample shows you that ability. When you drag the vertexs of the line, its label will be displayed and dragged with the point together. It is a little different to your requirement, but we just can do that now because we don't have a way to determine the labels' position exactly. For your second requirement, we need to have a investigations on that.
I would also be interested in a way to determine a label’s position, but for both general selection selection scenarios and for dragging where the point is moved when a label is dragged.
I already have these working fine when for clicks in the point’s display icon bounds. However, there’s a bit of a useability issue remaining since Windows users are accustomed to being able to select via labels, which does nothing within my maps since I can’t tell if they clicked on a label or not. This is further compounded by the fact that the labels often cover a larger screen area in the map than the point display icons, so the labels offer a better potential click target. The end result is a rather frustrating end user experience that I would really like to remedy if at all possible…
I think that what you are asking is possible and we can create a little sample app to show that. But first, I need to make sure I understand well your requirements:
-On the map, there are aircraft moving around based on their updated position.
-Each aircraft is represented by an icon
-Each aircraft has a label with two column values on two lines. There is a line between the label and the icon to avoid confusion on what label belongs to what icon if the icons are close together.
-On aircraft can be selected by clicking either on its icon or its label
-When the aircraft is selected, the icon and label are showed differently and the label shows more info from additional columns (extended).
-The label can be dragged to change its position relative to the icon with the line still there to show the relation with the icon
-As the aircraft moves, the label keeps moving too relative to the icon.
Can you confirm us this is what you are expecting? Thank you.
I think that your issue for being able to select a feature by clicking on it label, not just the icon representing it, is addressed in one in the previous post for Feng. We are gathering the exact requirements first to create a sample that will meet with your needs and Feng's. Thank you.
Yes, an answer to Feng’s question should definitely address mine. I responded mostly to let you know that Feng isn’t the only one interested in an answer.
We developed the label I decribed before based on MapObjects. MapObjects does not support this kind label either, but we can draw text on map to mimic labeling. Operators can click the text and select it ,then drag to an other position. Also we can re-draw the text when the aircraft moving. May be we can do the same on Map Suite?
We are working on the requirements now, as so far, the first step was finished, the icon and the label can be selected and dragged separately, also you can set the label text easily by yourself. We are researching the rest requirements for you, the attachment is the sample for the first step of your requirement.Please take a look at it also you can do the further investigations for drawing the line for the relative label and icon by yourself.
Of the requirements you are expecting, the attached sample in the previous answer from Scott answers part of the requirements of number 5. What are the other important requirements you would like Scott to work on?
YOUR REQUIREMENTS:
1) On the map, there are aircraft moving around based on their updated position.
2) Each aircraft is represented by an icon
3) Each aircraft has a label with two column values on two lines. There is a line between the label and the icon to avoid confusion on what label belongs to what icon if the icons are close together.
4) On aircraft can be selected by clicking either on its icon or its label
5) When the aircraft is selected, the icon and label are showed differently and the label shows more info from additional columns (extended).
6) The label can be dragged to change its position relative to the icon with the line still there to show the relation with the icon
7) As the aircraft moves, the label keeps moving too relative to the icon.
We estimate that anything beyond that should be considered professional services due to the breadth of your requirements. You should be contacted by your salesman on that. Thank you.
Please get the latest version to try again, the latest version number is 4.5.162.0, we just added the ability to our product recently, so please get an newer version to try,