Getting to Know Web GIS. Pinde Fu
Чтение книги онлайн.
Читать онлайн книгу Getting to Know Web GIS - Pinde Fu страница 18
1 Click the symbol for the 0.94 to 1 class, click Use an Image, specify https://i.imgur.com/OS8tZpq.gif (or the short equivalent http://bit.ly/2F0fQVq) as the URL, click the Plus icon, set its size to 16, and then click OK.The last class lost population from 2010 to 2016, so the class was symbolized using a solid down arrow.
2 Click OK, and then click Done to exit the Change Style pane.
3 In the Contents pane, point to the Top 50 US Cities layer, click the More Options button , and click Save Layer.This step saves the style to the layer item itself. When you add this layer to any web maps, the layer will carry the style you defined in this section as the default style.Next, you will change the basemap to a neutral background.
4 Click the Basemap button on the map viewer toolbar, and click Light Gray Canvas.This basemap provides a neutral background with minimal colors, labels, and features. This background allows your operational data layer to stand out clearly.
5 Save your web map.
You have configured the style of your operational layer. With this map, you can quickly and easily see which cities had population increases or decreases.
2.3 Configure a layer pop-up using ArcGIS Arcade
In this section, you will decide what information to show and how you will show the information in the cities’ pop-ups.
1 With your web map open in the map viewer, click one of the 50 cities to see the default pop-up.If a pop-up window does not appear, it may be disabled for this layer. You can enable the pop-up by pointing to the layer, clicking the More Options button and clicking Enable Pop-up.This default pop-up is useful, but you can enhance the window to communicate information in more intuitive and engaging ways.
2 In the Contents pane, point to the Top 50 US Cities layer, click the More Options button , and click Configure Pop-up.The Configure Pop-up pane appears, in which you can configure the pop-up’s title, contents, and media sections. Next, you will configure the title, which can be static text, a set of attribute field values, or a combination of the two.
3 Click the Plus button under Pop-up Title to select the City field. Type a comma and a space, and click the Plus button again to select the State field.Next, you will configure the pop-up contents, which can include a list of attribute fields or a custom description based on attribute values. You will first create a couple attribute expressions using Arcade.
4 Under Attribute Expressions, click the Add button.The expression editor window appears. Next, you will build the expression Round($feature .Estimate2016 / $feature.Census2010, 2), which calculates the ratio of population 2016 and 2010 for each city, and rounds the result to two decimals.
5 In the expression editor, do the following:Click the Edit link by the title Custom and change the title to Population Ratio 2016/2010.Click in the Expression text area.Click Functions, search and click Round.In the Expression area, remove fieldOrValue.Click Globals, find and click $feature.Estimate2016, press the / key, and find and click $feature.Census2010.Click numPlaces and change it to 2.Click Test to verify if the results look correct. If not, correct the expression based on the error message.Click OK.
Next, you will build an expression like Round($feature.PopOwnOcc / $feature .Census2010, 2) * 100, to calculate the percentage of population-owned housing in 2010 for each city.
1 Under Attribute Expressions, click the Add button again. In the expression editor, perform the following actions:Change the title to % Population Own Houses.Set the expression to Round($feature.PopOwnOcc / $feature .Census2010, 2) * 100.Click Test to make sure the results look correct.Click OK.
2 In the Display menu under Pop-up Contents, make sure A list of field attributes is selected, and then click the Configure Attributes link.In the Configure Attributes dialog box, make the following choices:Select {Rank} and set its alias as Rank 2016.Select the expression field Population Ratio (2016/2010).Select the expression field % Population Own Houses, and set its format to 0 decimal places.Clear the check boxes for the rest of the fields.
Some of the fields already appear in the title, and some others will be displayed in charts and image links. Thus, you unselect these fields.
Hiding them from the attribute list will make your layer pop-up simple and clear.
Click OK to close the Configure Attributes window.
1 At the bottom of the Configure Pop-up pane, click OK to apply your pop-up configuration.
2 Click any city on the map to review the new pop-up.You will see that the pop-up window is simpler and easier to read than the default pop-up. Also note the pop-up includes the custom expression you built with Arcade.
3 On the map viewer menu bar, click Save to save your changes.2.4 Add images and charts to pop-up windows
Media, such as images and charts, can more effectively engage users and improve their understanding of your data.
The tutorial CSV contains two URL fields, Wikipedia_URL and Picture_URL. You will use the first URL to add a picture to the city layer’s pop-up and the second URL to link the picture with the city’s Wikipedia page so that users can gather supplementary information about the city’s population changes. Charts require numeric attribute fields. The US cities layer contains several of these fields. You will display them in appropriate charts to exemplify the cities’ population trends.
1 In the Contents pane, point to the Top 50 US Cities layer, click the More Options button, and click Configure Pop-up.
2 In Pop-up Media, click Add, and then click Image.In the Configure Image window, make the following changes:Enter About the city as the title (leave the Caption window blank).In the URL box, click the Plus button, and click the Picture_URL field.In the Link (optional) box, click the Plus button and click the Wikipedia_URL field.
3 Click OK to close the Configure Image window.The image title, caption, image URL, and link URL can all take the form of static text, attribute field values, or a combination of the two. If you do not have image and link URL fields when you do the assignment, specify a static URL instead. For example, you can use http://www.census.gov/history/img/Census_Logo.jpg as the image URL, and http://www.census.gov as the Link URL. This way, the pop-up windows for all cities display the same image and link to the same web page. You can add additional images to your pop-up window simply by repeating steps 2 and 3.
4 In the Configure Pop-up pane, click the OK button to apply your pop-up configuration.
5 Click a city on the map to observe the new pop-up.The pop-up window displays the city’s seal or flag. If you click on the image, the city’s Wikipedia page will appear.
6 In the Contents pane, point to the Top 50 US Cities layer, click the More Options button, and click Configure Pop-up again. In the Pop-up Media section, click Add, and then click Line Chart.
7 In the Configure Line Chart window, make the following settings:For Title, specify Population Change (2010 - 2016).For