Select to view content in your preferred language

Please Help...Can't find any working sample for WMTS layer...

3084
4
Jump to solution
04-07-2012 10:32 AM
ChenfengXiong
Emerging Contributor
I searched through out the web and help files, no actual working sample using WMTSLayer added in API v2.5.
I tried to build one but failed. Experts! please tell me where am I wrong? I tried both two follwing methods but neither map load and no error message at all.

Method1:
<esri:WMTSLayer id="wMTSLayer"     url="http://www.simal.ryerson.ca:8080/geoserver/WoodStock/wmts"     serviceMode="KVP"     layerId="0"     imageFormat="png">       </esri:WMTSLayer>


Method2:
   public function initialize()    {     var wmtsLayer:WMTSLayer = new WMTSLayer("http://www.simal.ryerson.ca:8080/geoserver/WoodStock/wmts");     wmtsLayer.alpha = 1;     wmtsLayer.visible = true;     mainMap.addLayer(wmtsLayer,2);    } <esri:Map id="mainMap" />


P.S: I also tried to extend the TiledMapServiceLayer but the sample in the help missing the code of most important file "WMTSLayer.as" and I don't know which way is working...
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
IvanBespalov
Frequent Contributor
Samples I linked to you are samples for ArcGIS API for FLEX - so all links to skins, layers classes, other resources ... in samples are links to files included to API
[ATTACH=CONFIG]13328[/ATTACH]

if you read carefully notation in sample:
  <!-- 
   @@includeFiles com/esri/ags/samples/WMTSLayer.as   - not a namespace! what is it?

This sample shows how to add a Web Map Tile Service(WMTS) as a custom layer. 

The ArcGIS API for Flex allows for extending the API 
to access layer types not included as part of the API. 
In this example, tiled layers (TiledMapServiceLayer) is extended to access WMTS tiles. 

Steps involved: 
1. Creating new ActionScript class(WMTSLayer.as) that extends TiledMapServiceLayer. 
2. Hardcoding some of the configuration settings: 
fullExtent, initialExtent, spatialReference, tileInfo, and units. 
3. Overriding the protected function getTileURL() to obtain the appropriate 
tiles and place them accurately on the map. 
4. Using the extended class with MXML or ActionScript 🙂 
-->

View solution in original post

0 Kudos
4 Replies
IvanBespalov
Frequent Contributor
Chenfeng,

I searched through out the web and help files, no actual working sample using WMTSLayer ...


WMTS sample - ArcGIS API for FLEX 3.0 (beta)

WMTS sample - ArcGIS API for FLEX 2.5 (last release)
0 Kudos
ChenfengXiong
Emerging Contributor
Chenfeng,

WMTS sample - ArcGIS API for FLEX 3.0 beta
the same as
WMTS sample - ArcGIS API for FLEX 2.5


Thanks for reply. But I saw this long time ago and the most important code of file "WMTSLayer.as" is missing.
I'll be very appropriately if you could find a copy of that file. Thanks!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Chenfeng,

  You can find all the files you need including the WMTSLayer.as in the Flex API download.

arcgis_api_for_flex_3_0pr\ArcGIS_Flex\samples\src\com\esri\ags\samples\WMTSLayer.as
0 Kudos
IvanBespalov
Frequent Contributor
Samples I linked to you are samples for ArcGIS API for FLEX - so all links to skins, layers classes, other resources ... in samples are links to files included to API
[ATTACH=CONFIG]13328[/ATTACH]

if you read carefully notation in sample:
  <!-- 
   @@includeFiles com/esri/ags/samples/WMTSLayer.as   - not a namespace! what is it?

This sample shows how to add a Web Map Tile Service(WMTS) as a custom layer. 

The ArcGIS API for Flex allows for extending the API 
to access layer types not included as part of the API. 
In this example, tiled layers (TiledMapServiceLayer) is extended to access WMTS tiles. 

Steps involved: 
1. Creating new ActionScript class(WMTSLayer.as) that extends TiledMapServiceLayer. 
2. Hardcoding some of the configuration settings: 
fullExtent, initialExtent, spatialReference, tileInfo, and units. 
3. Overriding the protected function getTileURL() to obtain the appropriate 
tiles and place them accurately on the map. 
4. Using the extended class with MXML or ActionScript 🙂 
-->
0 Kudos