AnsweredAssumed Answered

Search Widget on my own data

Question asked by SteveAdams on Oct 16, 2015
Latest reply on Oct 16, 2015 by khutchins-esristaff

I have started to make the journey from Flex to javascript.

I am really new at this so forgive me.

I can get my map layer to show up but

  just can't seem to get the search to look at my mapserver

ArcGIS API for JavaScript | Basic Search


<!DOCTYPE html>

<html dir="ltr">




   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

   <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />

   <title>ArcGIS API for JavaScript | Basic Search</title>

   <link rel="stylesheet" href="">

   <link rel="stylesheet" href="">




      #map {

         height: 100%;

         width: 100%;

         margin: 0;

         padding: 0;


      #search {

         display: block;

         position: absolute;

         z-index: 2;

         top: 20px;

         left: 74px;



   <script src=""></script>


       var map;









      ], function (Map, Search) {

          var initExtent = new esri.geometry.Extent({ "xmin": -119.609356, "ymin": 36.780374, "xmax": -119.797153, "ymax": 36.895779, "spatialReference": { "wkid": 4326} });

          map = new esri.Map("map", { extent: initExtent });

          var MyMapLayer = new esri.layers.ArcGISDynamicMapServiceLayer("", {







          var s = new Search({

              enableButtonMode: true, //this enables the search widget to display as a single button

              enableLabel: false,

              enableInfoWindow: true,

              showInfoWindowOnSelect: false,

              map: MyMapLayer

          }, "search");



          var sources = [];




              featureLayer: new FeatureLayer(""),

              searchFields: ["FULL_ADDRESS"],

              displayField: "FULL_ADDRESS",

              exactMatch: false,

              name: "test",

              outFields: ["*"],

              placeholder: "test",

              maxResults: 6,

              maxSuggestions: 6,



              enableSuggestions: true,

              minCharacters: 0




          //Set the sources above to the search widget

          s.set("sources", sources);










   <div id="search"></div>

   <div id="map"></div>