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
Developing Mobile Web ArcGIS Applications

You're reading from   Developing Mobile Web ArcGIS Applications Learn to build your own engaging and immersive geographic applications with ArcGIS

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781784395797
Length 156 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Adding a legend


A user can tap a feature and see the details in a mobile-enabled popup. It would be nice to differentiate more easily between the respective map and feature layers. To do this, a legend would be an excellent addition. For the next code sample, we will again use our starter code sample: http://www.webmapsolutions.com/book/mobilearcgis/chapter4/MobileMapBase2.html. Let's begin by showing you a screenshot of the application that you are about to build:

ArcGIS Legend widget

Notice the layout. The screen is subdivided into two: a map and a legend panel. First, we need to update our code to include this new layout. In this code example, we need to update the style first by changing the map width and adding rightPane:

    <style>
        html, body, #map {
      height: 100%;
      width: 98%;
      margin: 0;
      padding: 0;
       }
      #rightPane {
      width: 20%;
height: 100%;
      background: White;
      position: absolute;
      top:1px;
      right:1px;
     ...
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