I am new in GIS programming, I have to created a geoportail with the Configurable Map Viewer (CMV). I want to add my KML layers but they don't appear in the map. Below is the part of my code

operationalLayers: [{
            type: 'kml',
            url: "http://localhost:6080/arcgis/rest/services/ban/MapServer/",
            title: 'banques',
            options: {
                id: 'libelle',
                opacity: 1.0,
                visible: true,
                outFields: ["*"],
                mode: 0
            },
            editorLayerInfos: {
                disableGeometryUpdate: false
            },
            legendLayerInfos: {
                exclude: false,
                layerInfo: {
                    title: 'My layer'
                }
            }
  }, {
            type: 'kml',
            url:    'http://localhost:6080/arcgis/rest/services/ban/MapServer',
            title: 'Region Rabat Sale',
            options: {
                id: 'key',
                opacity: 1.0,
                visible: true,
                mode: 0
            }
  },

   ],
up vote 1 down vote accepted

The url you've shown in your code is not for kml. It is for an ArcGIS Server MapServer. If that is the source of the data, you should use type: 'dynamic'.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.