Configure application

The Park and Recreation Finder application consumes services that are accessible to citizens in your community. You can configure Park and Recreation Finder application and share it with citizens. Citizens can then access the application on their smartphones, tablets, and desktop computers.

Configuring routing

The application can draw routes and provide directions using the ArcGIS Online World Route Service. The World Route Service is an ArcGIS Online for organizations subscription service that uses credits when routes are generated.

Learn more about credit usage when creating simple routes

To use routing for this application, an ArcGIS Online for organizations subscription is required and routing must be enabled in the configuration file. To use this application without drawing routes and providing directions, disable routing in the configuration file. When routing is disabled, the application maintains all other functionality.

To disable or enable routing in this application, complete the following steps:

  1. Using Windows Explorer, browse to <your directory>\Application\ParksFinder\js.
  2. Open config.js in Notepad or another text editor.
  3. Change the value of the GetDirections tag in the Info Popup section of the file to false or true depending on how want to enable your application.
false Application will not draw routes or provide directions.
true Application draws routes and provide directions.
            
//Set this variable to true/false to enable/disable directions
//if this master variable is set to false, directions cannot be enabled for any of the devices
GetDirections: true,
            
        

Configure the application

Modify the application configuration file to use the services you previously published.

To configure the application, complete the following steps:

  1. Using Windows Explorer, browse to <your directory>\Application\ParksFinder\js.
  2. Open config.js in Notepad or another text editor.
  3. Replace each URL with the path to your corresponding service. If you are having trouble finding the correct URL, search for yourserver to find the URLs that need replacing.
    Replace each of these URLs... With URLs for these services from your REST endpoint...
    http://yourserver/arcgis/rest/services/GeneralPurpose/MapServer GeneralPurpose basemap
    http://yourserver/arcgis/rest/services/ImageryHybrid/MapServer ImageryReference basemap
    http://yourserver/ArcGIS/rest/services/Parks/FeatureServer/0 Parks service
    http://yourserver/ArcGIS/rest/services/Parks/FeatureServer/1 Parks service
    http://yourserver/ArcGIS/rest/services/Geometry/GeometryServer Geometry service
  4. Save the file and exit.

Configure the Trails map (Optional)

The Trails map displays trail locations. This configuration of the Park and Recreation Finder application requires the Trail service and an additional configuration of the application.

To add this map to the Park and Recreation Finder application, complete the following steps:

  1. Using Windows Explorer, browse to <your directory>\Application\ParksFinder\js.
  2. Open config.js in Notepad or another text editor.
  3. In the Reference Overlay section, change DisplayOnLoad tag from false to true.
  4. Replace each URL with the path to your corresponding service. If you are having trouble finding the correct URL, search for yourserver to find the URLs that need replacing.
    http://yourserver/ArcGIS/rest/services/Trails/MapServer Trail service
                  
    // ServiceUrl is the REST endpoint for the reference overlay layer
    // DisplayOnLoad setting that shows the reference overlay layer on load.
    
    ReferenceOverlayLayer: {
        ServiceUrl:"http://yourserver/ArcGIS/rest/services/Trails/MapServer",
        DisplayOnLoad:true
    },
                  
              
  5. Save the file and exit.

Add and register an application with your ArcGIS Online organizational account (Optional)

This application can draw routes and provide directions using the World Route Service. To access this functionality, the application must be registered with an ArcGIS Online for organizations account.

These steps are not necessary if routing and directions will not be made available in your application. If routing has been disabled for your application, skip to configuring the proxy.

To register your application, complete the following steps:

  1. Add the application to your ArcGIS Online for organizations account using the following parameters:
    • The item is: An Application and item type is Web Mapping
    • URL: Type the URL for you application
    • Purpose: Ready To Use
    • API: JavaScript
    • Title: Type the application title
    • Tags: Add the application tags
  2. Register your app using the following parameters:
    • App Type: Browser
    • Redirect URI: Type the fully qualified URI for your server and the web server port. This is usually port 80, not the port for ArcGIS for Server (port 6080), for example http://servername.domain:[80].
  3. Copy the App ID and App Secret values to a text file for use later in the configuration.

Configuring the proxy

The proxy file gives the application access to the location of the services.

To configure the proxy, complete the following steps:

  1. Using Windows Explorer, browse to <your directory>\Application\ParksFinder\proxy and open proxy.config in Microsoft Notepad or another text editor.
  2. Copy the App ID and App Secret values from the text file to the appropriate tags, if you've enabled routing and registered your application with your ArcGIS Online organizational account, otherwise skip to step 4 below.
    App ID clientId="App ID"
    App Secret clientSecret="App Secret"
  3. Set the rateLimit and rateLimitPeriod values.
    Rate Limit rateLimit="50"
    Rate Limit Period (in minutes) rateLimitPeriod="10"
  4. Enter the URL of each ArcGIS Services Directory referenced in the configuration of the application. Each URL must be enclosed in a set of serverURL tags. If default URLs are listed, ensure these URLs are not removed. All web traffic goes through the proxy and the default URLs are required by the application.
  5. Save the file and exit.
Top