Customisation of information panel in CE Web Viewer

3664
4
08-06-2013 06:34 AM
MattO_Keeffe1
New Contributor
I can't find any information about this in the help file, forums or elsewhere online.

When I click on an object in the CE Web Viewer I'd like to define the content which is returned in the information panel.  Essentially there are five things which I (as the author of the web scene) need to control:

1. I want to hide particular attributes which are associated with the object (held in both GDB and shapefile) so that they aren't displayed in the information panel.
2. I want to control the order of the attributes in the list (which currently don't resemble the order in the GDB/shape).
3. I want the ability to format particular attributes. I'd like, for example, to be able to place a dollar sign and comma separation in a number representing currency.
4. I want the ability to use aliases for field names - particularly necessary for shapefiles where fields names mean nothing to anyone except the data owner.
5. The 'name of selected object' which is automatically returned by CE Web Viewer.  Currently this says 'Shape_27', etc. but it would be better if I could use an attribute (or an expression combining two or more attributes) from the object here.  If not, I'd at least like to be able to turn it off.  And the 'Properties' section which gives me the elevation and height.

Thanks,

Matt
Tags (2)
0 Kudos
4 Replies
JoanneO_Brien
Occasional Contributor
I'm not sure about your first points but I can suggest for the last two:

4. you can change the name of a field easily by clicking on it in CityEngine and in the Inspector window it will come up with the name it's displaying, just label it with what you want it to display.
5. This is similar to the answer in 4 where if you select the shape you want to name, at the top of the Inspector window is the name which you just need to change there.

perhaps python script exporting could be used for some of the other stuff??
0 Kudos
MattO_Keeffe1
New Contributor
4. you can change the name of a field easily by clicking on it in CityEngine and in the Inspector window it will come up with the name it's displaying, just label it with what you want it to display.

I don't appear to be able to change the field name in the inspector window. I guess you mean 'label it with what you want to display' by changing the text under the 'Object Attributes' section, but these are locked and I can't change them.

5. This is similar to the answer in 4 where if you select the shape you want to name, at the top of the Inspector window is the name which you just need to change there.

Yes, I can do this manually, but I've got hundreds - if not thousands - of objects that I need to do this for. It would be a shame to have to do this manually when the values are already stored in the object. Not only that, if I have more than one word in the name (separated by one or more spaces), the words are concatenated and the spaces are lost when exported to a CE Web Scene.
0 Kudos
AndreasUlmer
Esri Contributor
Hi Matt

There are not many built-in options into the information display.

1. At the moment the only option to do this is to delete the attribute.
2. CityEngine exports the attributes in reverse order to the 3ws. This is going to be fixed with the upcoming CityEngine version.
3. Not possible so far (except using iframe)
4. Not possible so far (except using iframe or CE python export script)
5. The easiest way to do this is to rename the objects in CityEngine using attribute info (with Python script)


There are two possible approaches to do such things, however both include a bit of knowledge and work.


a). use a python export script in CityEngine to prepocess the data before export
write a python script that
1. loops over all shapes, and rewrites the attributes / the name to fit your requirements
2. triggers the 3ws export
3. (if desired) undoes the attributes to state before export



b). use iframe attributes that link to your externally hosted page
an attribute containing iframe code in value will embed the iframed html page in the information display.
This way you can basically create your own customized information display by processing the iframe url with a server-side script (e.g. php, ashx)

e.g.
* prepare all shapes in CE to have an attribute of the form <iframe src="http://MYSERVER/MYPAGE.php?attr1=a&attr2=b&..."> (e.g. with Python, or already from the src data)
* prepare MYPAGE.php to interprete the url params and render to html as desired


does that help you further?

best
Andreas
0 Kudos
MattO_Keeffe1
New Contributor
Hi Andreas, thanks for your reply.

Point 3, 4 and 5 are the most important for me in terms of aesthetics on a site.  Is it likely that these requirements are going to be served by furture CE/WS versions?  If so, is there any indication as to when this might be?

I can have a look at putting something together which will utilise asp.net to inject values into the information panel but, if I'm honest, I'd prefer to see this in the software itself.  Presumably this sort of work is going to be replicated by numerous organisations who use 3WS.  If I and my contemporaries can write the code to do it then I'd have hoped ESRI could too.

Are there any examples of sites which are using the server-side scripting approach to do this?
0 Kudos