AnsweredAssumed Answered

Add layer from Arcgis Server to API Javascript

Question asked by vincent_choffrut on Jan 27, 2015
Latest reply on Jan 27, 2015 by vincent_choffrut

Hello everyone,

I would like to add a layer (stored with arcgis server on localhost -as you can see with the url) on my map (and this SHOULD be quite simple).

can someone tell me why this simple script isn't working? (it loads the topo basemap, ok, but NO LAYER)

 

<script>

            var map;

      require

            (["esri/map",

                "esri/layers/FeatureLayer",

                "dojo/domReady!"],

               

                    function(Map,

                    FeatureLayer)

                        {

                            var map = new Map("map",

                            {

                            basemap: "topo",

                            center: [0.694357, 47.395560],

                            zoom: 8

                            });

                   

                            var rivers = new esri.layers.FeatureLayer("http://localhost:6080/arcgis/rest/services/CARTAGES/Lineaire_Hydro_Loire_Bretagne/MapServer");

                       

                            map.addLayer(rivers);

                        }

            ); 

    </script>

 

thanx a lot in advance

vincent

Outcomes