Select to view content in your preferred language

WMTS Map canot display in overViewWidget

721
3
Jump to solution
08-08-2013 11:54 PM
pracZHEN
Deactivated User
hi there,as the title said, i add two basemap layers instead of addarcgisbasemaps="true" in config.xml
<layer label="TianDiTuWMTSMap"  type="wmts" visible="true" alpha="1.0"                      style="default" servicemode="KVP" layerId="vec" tilematrixsetid="w"                      url="http://t0.tianditu.com/vec_w/wmts" /> <layer label="TianDiTuAnnotation" type="wmts" visible="true" alpha="1.0"                      style="default" servicemode="KVP" layerId="cva" tilematrixsetid="w"                       url="http://t0.tianditu.com/cva_w/wmts"/>

But the result is that they can display in Map view rather than OverViewMapWidget(its blank even without the red box), i read the Post Questions and Answers in forum,and make some mod in OverViewMapWidget.xml as below code:
<?xml version="1.0"?> <configuration>     <!-- possible values for initialstate: open or closed (default) -->     <initialstate>closed</initialstate>     <!-- by default it will use the same basemap as current main map,          you can hardcode as below if you wish -->     <layer             type="wmts"             mode="static"             visible="true"             url="http://t0.tianditu.com/vec_w/wmts"/>      </configuration>

and in the OverViewMapComponent.mxml there isnot any code about WMTS so i add WMTS item as other type service:
 public function set configXML(value:XML):void             {                 ..............................................                                 case "osm":                                 {                                     var osmLayer:OpenStreetMapLayer = new OpenStreetMapLayer();                                     osmLayer.alpha = alpha;                                     osmLayer.id = label;                                     osmLayer.name = label;                                     osmLayer.visible = visible;                                     layerToAdd = osmLayer;                                     break;                                 } //   added by Prac 20130809     To display WMTS map  in  OverviewMapWidget            case "wmts":     {        var wmtsLayer:WMTSLayer =new WMTSLayer();                                                                   wmtsLayer.alpha = alpha;        wmtsLayer.id = label;        wmtsLayer.name = label;        wmtsLayer.visible = visible;        layerToAdd =wmtsLayer;        break;     } //   added by Prac 20130809     To display WMTS map  in  OverviewMapWidget                                                                 if (layerToAdd)                             {                                 overviewMap.addLayer(layerToAdd);                                 basemapLayerObjectToLayer[basemapLayerObject] = layerToAdd;                             }                                                      }

after all these done it still doesnot work out, do you have any suggestion for this, thanks for your help.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Prac,

   This might get you going:

//   added by Prac 20130809     To display WMTS map  in  OverviewMapWidget                                             case "wmts":                 {                    var wmtsLayer:WMTSLayer =new WMTSLayer(urlBaseMap);                    wmtsLayer.alpha = alpha;                     wmtsLayer.alpha = alpha;                    wmtsLayer.id = label;                    wmtsLayer.name = label;                    wmtsLayer.visible = visible;                    if (proxyUrl && useProxy)                    {                         wmtsLayer.proxyURL = proxyUrl;                    }                    wmtsLayer.serviceMode = basemapLayerObject.serviceMode;                    layerToAdd =wmtsLayer;                    break;                 } //   added by Prac 20130809     To display WMTS map  in  OverviewMapWidget


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Prac,

   This might get you going:

//   added by Prac 20130809     To display WMTS map  in  OverviewMapWidget                                             case "wmts":                 {                    var wmtsLayer:WMTSLayer =new WMTSLayer(urlBaseMap);                    wmtsLayer.alpha = alpha;                     wmtsLayer.alpha = alpha;                    wmtsLayer.id = label;                    wmtsLayer.name = label;                    wmtsLayer.visible = visible;                    if (proxyUrl && useProxy)                    {                         wmtsLayer.proxyURL = proxyUrl;                    }                    wmtsLayer.serviceMode = basemapLayerObject.serviceMode;                    layerToAdd =wmtsLayer;                    break;                 } //   added by Prac 20130809     To display WMTS map  in  OverviewMapWidget


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

0 Kudos
pracZHEN
Deactivated User
Prac,

   This might get you going:

//   added by Prac 20130809     To display WMTS map  in  OverviewMapWidget                            
                case "wmts":
                {
                   var wmtsLayer:WMTSLayer =new WMTSLayer(urlBaseMap);
                   wmtsLayer.alpha = alpha; 
                   wmtsLayer.alpha = alpha;
                   wmtsLayer.id = label;
                   wmtsLayer.name = label;
                   wmtsLayer.visible = visible;
                   if (proxyUrl && useProxy)
                   {
                        wmtsLayer.proxyURL = proxyUrl;
                   }
                   wmtsLayer.serviceMode = basemapLayerObject.serviceMode;
                   layerToAdd =wmtsLayer;
                   break;
                }
//   added by Prac 20130809     To display WMTS map  in  OverviewMapWidget


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:



Robert:
Thanks a lot ,and sorry  for late to reply,i will try this on Monday(in China) for the project is in my company's PC,and i will post result as soon as possible, thanks again.
0 Kudos
pracZHEN
Deactivated User
Prac,

   This might get you going:

//   added by Prac 20130809     To display WMTS map  in  OverviewMapWidget                            
                case "wmts":
                {
                   var wmtsLayer:WMTSLayer =new WMTSLayer(urlBaseMap);
                   wmtsLayer.alpha = alpha; 
                   wmtsLayer.alpha = alpha;
                   wmtsLayer.id = label;
                   wmtsLayer.name = label;
                   wmtsLayer.visible = visible;
                   if (proxyUrl && useProxy)
                   {
                        wmtsLayer.proxyURL = proxyUrl;
                   }
                   wmtsLayer.serviceMode = basemapLayerObject.serviceMode;
                   layerToAdd =wmtsLayer;
                   break;
                }
//   added by Prac 20130809     To display WMTS map  in  OverviewMapWidget


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:



Robert:
Your solution is work well with the hardcode i write in OverViewMapWidget.xml removed,thanks ! now all layers display well.;)
0 Kudos