Question

4400
4
Jump to solution
11-19-2014 01:02 PM
MilerDouglas
New Contributor

On the code Geocoder widget | Guide | ArcGIS API for JavaScript there are two points to explain:

query(".spotlight").addClass("spotlight-active").style({
      width
: max + "px",
      height
: max + "px",
      margin
: margin
  
});

Does this code add an extra element (the .spotlight element) and ads the spotlight-class to it?

There is already a class with the name .spotlight.

On evt.result.feature.geometry (actually I  want to see all the objects the event handler pass as argument). Where are all these properties?

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

The select event returns a result object with the following properties: extent, feature and name. View the API reference for extent and feature to see the available properties. Name is just a string.

The code below uses dojo/query to look for an element with a class named spotlight assigned. When it finds this element it adds an additional class called spotlight-active.

query(".spotlight").addClass("spotlight-active").style({
      width
: max + "px",
      height
: max + "px",
      margin
: margin
  
});

View solution in original post

0 Kudos
4 Replies
PaulCrickard1
Occasional Contributor II

You could probably use the JavaScript console in Chrome (f12) or just put this code in: It will alert each key and the value.

for (var key in evt.result){

  alert(key+": "+evt.result[key]);}

0 Kudos
PaulCrickard1
Occasional Contributor II

If it returns [object], which it should on evt.result['feature'], then just change the code to evt.result.feature and then it will return the keys for that object (geometry being one).

0 Kudos
KellyHutchins
Esri Frequent Contributor

The select event returns a result object with the following properties: extent, feature and name. View the API reference for extent and feature to see the available properties. Name is just a string.

The code below uses dojo/query to look for an element with a class named spotlight assigned. When it finds this element it adds an additional class called spotlight-active.

query(".spotlight").addClass("spotlight-active").style({
      width
: max + "px",
      height
: max + "px",
      margin
: margin
  
});

0 Kudos
MilerDouglas
New Contributor

I want to ask some more things:

1) Is there any way to check if someone has pick an address only from a specified country or to check if someone

has pick a real address from a map?

2) How display only a map from only a specified country?

Please help m(For e to start over the api.

Thanks in advance!

For instance geocoder doesn't display all the addresses from Greece.

So I want someone dbl click and pick an address from the map.

I  want to check if this address is from Greece.

0 Kudos