ArcGIS API for Silverlight (6): layer type Summary

Source: Internet
Author: User
In the process of developing with SilverlightAPI, data submitted from the client to the server or returned from the server must be displayed in the browser, specifically, it is in the Map control. However, based on their different types, such as the data source, map service type, and whether to cache, it determines that they will be in a certain layer. The previously mentioned GraphicsLayer is a layer. A clear understanding of these layer types is important for map data processed between the server and the client.
All layers are inherited from the Layer type. For details, refer to the object model diagram in the downloaded API.
Layer
| -- TiledMapServiceLayer
| -- ArcGISTiledMapServiceLayer
| -- DynamicLayer
| -- DynamicMapServiceLayer
| -- ArcGISDynamicMapServiceLayer
| -- ArcGISImageServiceLayer
| -- GPResultImageLayer
| -- GraphicsLayer
| -- FeatureLayer
| -- ElementLayer
Let's take a look at these layers in order, including the FeatureLayer exclusive to the Silverlight API.

1. Layer:
Inherited from DependencyObject in Silverlight and implemented the INotifyPropertyChanged interface, which is the base class of other layers in Silverlight API. We can regard it as wheat, and then delicious cool skins. It is used to make bubbles;

2. TiledMapServiceLayer:
Inherited from Layer, is the base class of all map services that use the cache. It can be used to add cached map services from different data sources to the program. For example, ArcGIS Server's Map service, Google Map, and Virtual Earth Map;

3. ArcGISTiledMapServiceLayer:
Inherited from TiledMapServiceLayer. As mentioned above, this layer extends TiledMapServiceLayer and supports the cached Map Service released by ArcGISServer 9.3; for example, the cache Map Service released by ArcGIS Server9.2 does not support restful connections. If you want to use it in the 93 client API, you can use TiledMapServiceLayer to extend a request such as ArcGISTiledMapServiceLayer92, to support the cache Map Service released by 92Server;

4. DynamicLayer:
Inherited from Layer, which is the base class of the dynamic map service;

5. DynamicMapServiceLayer:
Inherited from DynamicLayer, corresponding to TiledMapServiceLayer. To use an Uncached dynamic map service, you must extend this layer;

6. ArcGISDynamicMapServiceLayer:
It inherits from DynamicMapServiceLayer and is applicable to the dynamic map service released in ArcGIS Server9.3. Similarly, if you want to use other dynamic map services in the client API, such as the WMS service of OGC, you also need to extend the above DynamicMapServiceLayer to implement it like this layer;

7. ArcGISImageServiceLayer:
Inherited from DynamicMapServiceLayer, the image service for ImageService released by ArcGIS Server 9.3 is also a dynamic map service. In the client API, you can use the attributes of ArcGISImageServiceLayer to conveniently display the image data on the server through a browser, such as the BandIds attribute, you can quickly adjust the combination of image data display bands (RGB channel) and provide different results for users to view. Click here to view an instance;

8. GPResultImageLayer:
It inherits from DynamicMapServiceLayer and is applicable to the results produced by the Geoprocessing service. You can request the GP service on the server to dynamically generate an image and add the image to the Map control as a GPResultImageLayer layer;

9. GraphicsLayer:
Inherited from Layer, which is the place where the graphic data is displayed in a centralized manner. It has been discussed in detail in the fourth lecture;

10. FeatureLayer:
Inherited from GraphicsLayer, which is one of the highlights of the Silverlight API. It can be used to complete a dazzling function:

Download(657.33 KB)

 

The whole process can be implemented in xaml. You only need to insert the following code in the Layers of Map:

  1. <Esri: ArcGISTiledMapServiceLayer ID = "StreetMapLayer" Url = "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
  2. <Esri: FeatureLayer ID = "featurelayer"
  3. Url = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0"
  4. Where = "pop1990> 75000" ClusterFeatures = "True" FlareBackground = "#99FF0000" FlareForeground = "White" MaximumFlareCount = "9"
  5. FeatureSymbol = "{StaticResource markersymbol}">
  6. <Esri: FeatureLayer. OutFields>
  7. <Sys: String> CITY_NAME </sys: String>
  8. <Sys: String> POP1990 </sys: String>
  9. </Esri: FeatureLayer. OutFields>
  10. <Esri: FeatureLayer. MapTip>
  11. <Grid Background = "LightYellow">
  12. <StackPanel Margin = "5">
  13. <TextBlock Text = "{Binding Converter = {StaticResource MyDictionaryConverter },
  14. ConverterParameter = CITY_NAME, Mode = OneWay} "FontWeight =" Bold "/>
  15. <StackPanel Orientation = "Horizontal">
  16. <TextBlock Text = "Population (1990):"/>
  17. <TextBlock Text = "{Binding Converter = {StaticResource MyDictionaryConverter },
  18. ConverterParameter = POP1990, Mode = OneWay} "/>
  19. </StackPanel>
  20. </StackPanel>
  21. <Border BorderBrush = "Black" BorderThickness = "1"/>
  22. </Grid>
  23. </Esri: FeatureLayer. MapTip>
  24. </Esri: FeatureLayer>

Copy code

It can be seen that this FeatureLayer encapsulates a Query into a GraphicsLayer. Specify the layer to be queried through the url and where to specify the query condition (you can also enter the geometry to specify the queried image). The most important thing is ClusterFeatures = "True". When there are too many feature entries in a range, they are "aggregated" and expressed with a larger symbol. They are displayed separately when further zoomed in. If the aggregation target cannot exceed the number set by MaximumFlareCount, the flare animation will appear. In MapTip (inherited from GraphicsLayer), two lines of text are displayed in a Grid with a yellow background. The returned Graphic is returned using a DictionaryConverter class. the two fields in the Attributes set are converted to the String type and displayed. By the way, FeatureLayer can also be used for line or surface layer queries, but it makes no sense to continue using ClusterFeatures. Although the FeatureLayer encapsulation is too dead, it can only have this effect, but it provides us with an idea that we can combine the features of SilverlightRIA, make full use of your imagination to make better results. However, ClusterFeatures is a very useful feature for layers that need to display massive (hundreds of thousands) of points of data, after all, there is still a problem with the performance of such a multi-point presentation at the same time. If ClusterFeatures is not used, it looks like this:

Download(12.27 KB)

 

Do you need FeatureLayer?
Speaking of FeatureLayer, there are two Renderer that have to be mentioned: UniqueValueRenderer and ClassBreakerRenderer. They all rely on FeatureLayer and are used to render a single-value Topic map. The specific usage is relatively simple. You can view the Concepts in the API. However, the ThematicRendering example in Samples does not use the two types of Renderer. Instead, it artificially sets different symbrs for each Graphic. Although these two renderers are a little chicken, they are the only ready-made Renderer provided by the three client APIs, we can guess that there may be a more mature Topic Map Renderer in the next version of SilverlightAPI for us to use directly;

11. ElementLayer:
Inherited from Layer, which can be used to present the original FrameworkElement in Silverlight, such as video and audio. Although the Fill class can also be used to display a video in FillSymbol's Fill attribute, after all, some "stingy" elements can be placed by the other side in ElementLayer. You may ask, isn't Silverlight in layout elements such as Grid in addition to Map controls possible? Why should they be placed in ElementLayer? In fact, there is a problem that often plagued GIS developers, that is, to make some non-geographical data elements change with the MAP range (zoom in, zoom out, and PAN, instead of Manually changing the positions of these elements, you do not have to recalculate the client coordinates after Extent changes. Look, ElementLayer is solving this problem.

Currently, the Beta version of the API currently has so many layer types that may be added later. However, this is nothing more than derived from the base classes. In the next section, we will use an instance to see how to extend the MapServiceLayer of the base class to use non-ArcGIS Server data sources.

Address: http://bbs.esrichina-bj.cn/ESRI/thread-45537-1-1.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.