Cesium - Modify infobox contents - cesiumjs

I have n polygons with ids "test-1-1", "test-1-2" .... "test-1-n" which represent a single logical entity. Format of id can be generalized as < entity_name>-< entity_id>-< i>, where i is added to distinguish ids of multiple polygons.
My query here is, I want to display only "test" when any of these polygons is clicked. Currently id of selected polygon is displayed in info-box.
Is there any cesium way to do this? I would not prefer manipulating the strings at runtime.

A Cesium Entity has three fields of interest to the InfoBox (the thing that pops up when an Entity is selected).
entity.id - Each entity in a dataSource is required to have a unique id (a GUID will be auto-generated if no ID is supplied at creation). It is an arbitrary string and does not need to be human-friendly.
entity.name - This is the human-friendly name of the Entity. It does not need to be unique, you may have as many duplicate names as you like. It is half a line or less of plain text (not HTML).
entity.description - This is a sandboxed HTML description of the entity, and can span multiple paragraphs or include tables and other styling.
The InfoBox will attempt to show entity.name on its title bar by default, and will only fall back to show entity.id in the title bar if name is missing (because name is optional, id is not).
The body of the InfoBox only appears below the title bar if entity.description is set (otherwise only the bar is shown). The description is rendered with a sandboxed iframe (to offer some resistance to cross-site scripting for apps that display user-supplied entity descriptions).
I have n polygons with ids "test-1-1", "test-1-2" .... "test-1-n" ...
For this case, I would keep the existing ids, and set name to be the string you wish to see in the InfoBox popup. Multiple entities can have the same name but not the same id.

Related

Duplicate #id with json

I have placed in the head section json script - "#type" AutmotiveBusiness, describing business with unique "#id" - https://URL/#AutomotiveBusiness. Normally, in this case it will be visible on all of the subwebpages and it is.
Now I want to add breadcrumbs on the webpages in the following way so I can specify that subwebpage belongs to https://URL/#AutomotiveBusiness:
#type ListItem
position 1
item
#id https://URL/#AutomotiveBusiness
#type ListItem
position 2
item
#type AboutPage
The problem is when I do this in the mentioned way, the head section from subwebpage disappear when checked in the google structured data testing tool. I understand that here it's the same rule which apply to ID's in CSS.
I am wondering what can I do so the subwebpage will be clearly assigned to the https://URL/#AutomotiveBusiness in the breadcrumbs.
Your issue is caused because entities with the same ID are considered to be about the same thing, and they are merged.
You are trying to say that a trail in a breadcrumb is also an AutomotiveBusiness.
Change the IDs in the breqadcrumb trail so that they relate to the URLs for the WebPages in the trail.

Progress hide json fields

I'm using Progress OpenEdge.
I've created a dataset and nested a few temp-tables. I put in specific fields in order to relate the temp-tables.
In xml if you want to hide the fields that you use to relate the temp-tables you would use xml-node-type "HIDDEN" next to the field where you defined the temp-table.
So when you view the xml document after "dataset handle":write-xml("whatever-paramters"). The relation fields aren't seen.
The question...
How do I do the same with json?
I can't find anything that would resemble xml's xml-node-type "HIDDEN".
See the SERIALIZE-HIDDEN attribute.
http://knowledgebase.progress.com/articles/Article/000048926

Spring bean comma separating values, but I want to overwrite

Alright, so I'm pretty new to Spring, but I was asked to resolve a bug. So in our application, we have a page that queries a database based on an id. However, not all entries are unique to the id. The id and date pair, on the other hand, do define unique entries.
So this page takes in an id. If there is only a single entry related to this id, everything works fine. However, if there are multiple entries, the page displays a radio button selection of the various dates that pertain to that id. We use something like:
< form:radiobutton id="loadDate" path="loadDate" value="${date}" label="${date}" />
Later on the same page, we want to display the data for that option. As part of it, we display the date of that selection:
< form:input id="aiLoadDate" path="loadDate" maxlength="22" size="22" class="readonly" readonly="true"/>
The problem is that when this happens, the variable (or bean? I'm not quite sure about Spring yet..) loadDate (a string) ends up being the same date twice, seperated with a comma. I'm guessing the problem here is the "path="loadDate"" that is common to both lines.
Instead of appending the date to the already existing one like a csv, I'd like it to overwrite the current entry intead. Is there a way to do this?
Spring is not the direct cause of your problem. When the elements of an HTML form are submitted, each element will appear in the request as a name=value pair. If two or more elements in the form have the same name (not id, name attribute) then those elements appear in the request as name=value,value (with one value per element with a duplicated name).
Option 1: stop using an input as a display element. Just display the date in a span (or div or paragraph or what ever). If you want the look of an input box (border, etc.) use CSS to create a class that has the look you want and attach the class to the span (or div or paragraph, etc) in which you display the date.
Option2: continue using an input as a display element. Disabled input elements are not added to the request when the form is submitted. in the form:imput set disabled="true".

How to control column headings in the NEW/EDIT views based on the CATEGORY selected from a drop-down list. Ruby on Rails w/ MYSQL

Two models:
category has_many: components
component belongs_to: category
The CATEGORY table defines variable names for different component types:
TYPE, VAR1, VAR2, VAR3, ...
Insulator, Voltage, Height, Material, ...
Current Transformer, Voltage, Ratio, Indoor, ...
In the NEW/EDIT views for the COMPONENT model, the user will first section the CATEGORY from a drop-down list. Based on the CATEGORY selected the column headings and field labels in the form(s) need to dynamically update to indicate the variable names associated with the selected CATEGORY.
i.e. IF the user selects CATEGORY = Insulator THEN the field labels for VAR1 ... VAR3 are Voltage, Height, Material, etc.
I assume this will be controlled in the _form.html.erb of a typical scaffold. I am looking for a recommended technique.
Thanks in advance any information.
Changing a form in response to a user selecting a different option in a select tag is probably best done by Javascript. This allows for execution on the client side, which will be faster than a trip back to the server.
I would recommend placing the different form fields inside a div tag that is hidden when the page loads. Each of the combinations of categories can be toggled to show in the form by binding to the Javscript onChange event on the select tag.
Here is more information on the select tag: http://www.w3schools.com/jsref/event_onchange.asp

Compound object in HTML <button> value attribute

If for some reason it were mandatory to associate a <button> with more than one value, is there a good way to do it? For example ...
CSV:
<button value="Lancelot,Grail,blue">Answer</button>
JSON:
<button value="{'name':'Lancelot','quest':'Grail','color':'blue'}">Answer</button>
In the absence of a good way to do it, is there a traditional way?
Edit: another use case
Server M, the producer of the HTML, knows the user's current location and favorite genres, movie names, nearest theater, and next showtime. Server F knows how to query various 3rd party servers about how to get from point A to point B in order to arrive by time T. The user knows only the movie names: click Drag Me to Hell, and get the route. Server M could generate a form for each movie, with a single button showing the name of the movie and multiple hidden fields with the start and end locations and desired arrive-by time, but that would require a lot of repeated code. Every one of these one-button mini-forms would have the same method and action and the same hidden input field structure. Styling would be a collection of mini-forms rather than a collection of buttons, so FIELDSET and LEGEND are unavailable (because HTML forbids nested forms). Putting the parameters into the button's value attribute would be much tidier.
Well if you have to have a button element, why not use JavaScript to set a bogus property:
$('mybutton').compoundValue = { ... json ... };
and then reading the 'compoundValue's during form submit, etc.
Though really you might want to consider a group of checkboxes or some other form bits for what you're trying to accomplish.