Select to view content in your preferred language

search widget+4.6

3881
34
12-31-2017 02:15 AM
anjelinaponkerat
Frequent Contributor

Hi

I,m using search widget in 3d view by 4.6 version , but I can not use my feature service!! why? this is my sample:

      var search = new Search({
        sources: [{
          featureLayer: new FeatureLayer("https://services.arcgis.com/b6gLrKHqgkQb393u/arcgis/rest/services/TaxParcelQuery/FeatureServer/0", {
            outFields: ["*"],
            infoTemplate: new InfoTemplate("Parcels", "Owner name: ${OWNERNME1}</br>Parcel ID: ${PARCELID}</br>Site address: ${SITEADDRESS}")
          }),
          outFields: ["OWNERNME1","PARCELID","SITEADDRESS"],
          displayField: "OWNERNME1",
          suggestionTemplate: "${PARCELID}: ${SITEADDRESS}",
          name: "Parcels",
          placeholder: "example: Shawn Smith",
          enableSuggestions: true
      }],
        view: view
      }, "search");


      search.startup();
0 Kudos
34 Replies
RobertScheitlin__GISP
MVP Emeritus

Anjelina,

  This is becoming a little frustrating. You need to slow down and look at what I am saying. In your code above where is the "searchWidget" div in your html code?

  1. So you need a div called "searchWidget".

You still are ignoring my recommendation

For some reason you still have the above trailing comma and proceeding properties even though I mentioned this before.

var searchWidget = new Search({

sources: [{
featureLayer: new FeatureLayer("http://localhost/arcgis/rest/services/city_denver/FeatureServer/0", {
outFields: ["*"], //<--- REMOVE THIS COMMA

}),

Next would be a question, the basemaps you are using that only cover a small portion of the globe so what use is it to use a sceneview / 3D map?.. Visually your sceneview looks horrible. Even when I click on your "new base map" check box, is this really something you would use and show to people?

0 Kudos
anjelinaponkerat
Frequent Contributor

I am on local (Interanet)

this sample is just to show problem for you

0 Kudos
anjelinaponkerat
Frequent Contributor

did you test your suggest? I tested it and no result!!!  why?

var searchWidget = new Search({
sources: [{
featureLayer: new FeatureLayer("http://localhost/arcgis/rest/services/city_denver/FeatureServer/0", {
outFields: ["*"]

}),
outFields: ["name","town"],
displayField: "name",
searchFields: ["name"],
name: "name",
placeholder: "example: denver",
exactMatch: false,
zoomScale:10000,
maxResults:6,
maxSuggestions:6,
autoNavigate: true,
enableSuggestions: true
}],
view: view
}, "searchWidget");

view.ui.add(searchWidget, {
position: "top-left"
});

});
</script>
</head>

<body>
<div id="searchWidget" style="direction:rtl"></div>
<div id="viewDiv"></div>

<span id="layerToggle">
<input type="checkbox" id="streetsLyr"> new base map
</span>
</body>

</html>

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

I did test and the search widget shows up just fine, but does not add a zoom or add a marker or popup.

When I remove the ground layer you are using then the search works fine. I am not sure what the issue is but your dem layer is a problem.

0 Kudos
anjelinaponkerat
Frequent Contributor
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

One thing I can tell you is that the dem_denver (ImageServer)'s extent looks wrong:

Extent:
XMin: -1.1688638799535032E7

YMin: 4163840.6119491374

XMax: -1.1131948579326335E7

YMax: 4866018.920541309

Spatial Reference: 102100  (3857)

0 Kudos
anjelinaponkerat
Frequent Contributor

no its not related to extent. I have another dem layer that it's extent has not this problem but serach widget can not add marker and zoom to

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Anjelina,

 

  The search widget does not seem to work when using the custom Exaggerated elevation. I tested now using their url (from the sample) and it does not work either. So this sounds like a API limitation.

0 Kudos
anjelinaponkerat
Frequent Contributor

how we can be sure about this?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

If you were a US customer you could call esri tech support. But in your case you have to contact your local esri office.

0 Kudos