Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Web Applications with ArcGIS

You're reading from   Building Web Applications with ArcGIS Build an engaging GIS Web application from scratch using ArcGIS

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher
ISBN-13 9781783552955
Length 138 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Hussein Nasser Hussein Nasser
Author Profile Icon Hussein Nasser
Hussein Nasser
Arrow right icon
View More author details
Toc

Identifying restaurants

Now that we have added the feature layers, we can do our first query to identify the restaurants when you click on the map. The identify function is relatively easy to implement; all we need is the object InfoTemplate, which will display a pop up window when the user clicks on a restaurant. You can guess that this will be applied on the food_and_drinks layer and not on the landbase layer since this is where our data will be held. You can read more about the InfoTemplate object at https://developers.arcgis.com/javascript/jsapi/infotemplate-amd.html.

Fortunately, the InfoTemplate object allows us to create our own HTML result dialog box. We can display the field values by adding ${FIELD_NAME}, where FIELD_NAME is the name of the column that is to be displayed. This will be understood and converted into a corresponding value by InfoTemplate as explained in the following steps:

  1. Edit the mybestaurants.html file; first, we will create a string t, where we will save our desired...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image