Select to view content in your preferred language

Simbology Drawing Feature Service

3378
7
02-15-2010 12:21 PM
JoseSousa
Esri Contributor
Hello all,

Can anyone explain me a little bit the drawing of the simbology in ArcGIS API for Flex 2.0?

When I change a graphic element on the map, the applyEdits method on the FeatureService is called and the graphic get's updated. My question is ... is the image of the new simbology (for the changed geometry) generated in the FeatureService and returned to the client or in opposite the FeatureService only returns its specification (type and other properties) and the simbology is rendered on the client browser.

Thanks advanced,

José Sousa
ESRI Portugal
Tags (2)
0 Kudos
7 Replies
BjornSvensson
Esri Regular Contributor
The feature layer is a client-side layer, and thus the symbols are drawn client-side.  The symbol information is setup in the Feature Service (so created in ArcMap) and is part of the metadata for the layer (see for example the services directory for a feature service).
http://servicesbeta.esri.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/2

One way to figure out the details about what is happening here, and how, is to look at the actual http traffic.  This is a general good advice for debugging applications using the underlying REST API for ArcGIS Server 🙂

I use Firefox and the HttpFox extension but you can use whatever tool you prefer - Charles, Firebug, ...  Note that editing is done with POST (not GET), so here you need a tool that can support POST.

For example, start with http://help.esri.com/en/webapi/flex/samples/index.html?sample=EditorBasic
Click on a feature.
Change the "FType"
Look at the POSTed request to the feature service ("POST Data" tab if you're using HttpFox)
f   json
updates [{"attributes":{"OBJECTID":2826,"FType":"10101"}}]

and response (the "Content" tab if you're using HttpFox):
{"addResults":[],
"updateResults":[{"objectId":2826,"globalId" : null,"success":true}],
"deleteResults":[]}

Note that the service only returns success or failure.  The client already has the symbol information to render the feature correctly.
0 Kudos
JoseSousa
Esri Contributor
Thanks a lot for the explanation Bjorn.
I was using Fiddler for monitoring the requests but I was unsure
about the drawing process.

By your explanation it means that you must have in ArcGIS API for Flex some library that knows how to read the properties of the Feature Service and render the simbology of a feature according to its specification (Type, color, image, etc.). I was unsure if the API asked for some image to the Feature Service since I can create custom symbols in ArcMap.

Considering I understood correctly your explanation (forgive me if I not) what happens if I create a custom symbol in ArcMap with a new image. When I create the Feature Template Gallery it is interpreted/generated and when I publish the map service the FeatureService it provides all the properties Flex needs to render it on the map? How does it recognizes the new image?

Thanks for your patience 🙂

José Sousa
0 Kudos
BjornSvensson
Esri Regular Contributor
For FeatureLayer (as for ArcGISDynamicMapServiceLayer and ArcGISTiledMapServiceLayer), the API first makes a request for the metadata (also known as the service directory).

For example, http://servicesbeta.esri.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0
(We actually ask for the json, not html, but it is the same content).

If you change the image in ArcMap, you'll need to re-publish your service as well as making sure the REST cache is refreshed.  If not, Flex will still get the "old" metadata/images.  This is not specific to the symbols, but is true for any changes in a Map or Feature Service.

As for what symbols are supported, take a look at this post from the REST beta forum:
http://forumsbeta.esri.com/showthread.php?t=1269&referrerid=213

Hope this helps 🙂
0 Kudos
JoseSousa
Esri Contributor
Thank you very much Bjorn. I had already read the link of REST API but it was your explanation who made me understand how the simbology works.

Thanks a lot,
José Sousa
0 Kudos
OlivierROSSINI
Deactivated User
Hi,
I'm currently testing the flex API 2.0 and feature service.
My mxd file used to create the feature service contains rotated symbol (based on a field value).
In ArcMap rendering is fine. In the mapservice, rendering is fine as well. But in the feature service, the symbols are not rotated anymore.
Are rotated symbol supported in feature services?
If not, is it planned to support it?
or maybe there is another way to handle that like custom renderer ??? how to achieve that? any sample to help me?

By the way, I didn't find the list of supported symbology on the forum. using the link mentionned above.

Thanks in advance,

olivier
0 Kudos
BjornSvensson
Esri Regular Contributor
The forum post link changed with the new forums, try http://forums.arcgis.com/threads/1269-Feature-Service-Support-only-simple-symbology

The more up-to-date (maybe same) online help doc is at http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#/Authoring_fea...

Rotated symbols are supported.  For simple markers the angle set in ArcMap is listed in the Service Directory.  For character markers or picture markers, the server creates a rotated image, and thus the Service Directory will list an angle of 0.

What kind of markers are you using?  And what does the information in the Service Directory say?
0 Kudos
OlivierROSSINI
Deactivated User
thanks for your reply.
I'm using character marker symbol and the service directory says: angle = 0. but the image created by the server is not rotated.

olivier
0 Kudos