mapServiceLayer.getLayerDetails(...)
When the layer is loaded, the value becomes "true", and layer properties can be accessed. The onLoad event is also fired.
when you call a method, you know that it has done all of its work and returned something useful. Right? Well�?� not always. Sometimes that method will invoke web requests that need some time to process, or it may call another method that has to do some processing or is waiting for user input�?� These kinds of operations can be implemented asynchronously, and the only way to manage that logic programmatically is with a callback parameter.
var mapLayer= new esri.layers.FeatureLayer(layer.url,{ mode: esri.layers.FeatureLayer.MODE_SNAPSHOT, outFields: ["*"] }); dojo.connect(mapLayer, 'onLoad', function() { alert(mapLayer.fields); (undefined) alert(mapLayer.version); (undefined) });
type String The data type of the field.
fieldAliases Object Set of name-value pairs for the attribute's field and alias names.
Thanks Alex. I think I can work with this!Drew
Hello,I am doing a small ESRI JS API project and don't use it too often so the library is new to me..Anyways.. I cant find anyway to get field information.I am trying to write a function that will determine what the the OBJECTID field name is based on its data type (esriFieldTypeOID)The object is in the documentation (Field) but I can't find a way to get a field?In the Flex API you can call a a function like so... mapServiceLayer.getLayerDetails(...) Please help me get a fields array.Drew
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.