Esri / storymap-series

The Story Map Series lets you present a series of maps via tabs, numbered bullets, or a side accordion.
Apache License 2.0
63 stars 59 forks source link

Integrate a custom address locator (geocoder) #7

Closed EikeLueders closed 8 years ago

EikeLueders commented 8 years ago

We're currently try to implement a custom geocoder in our storytelling-application.

We followed the instructions and added the configuration to the commonConfig.js file in the application folder like this:

geocode: [{url: url_to_geocode_server,
    singleLineFieldName: "SingleLineCityName",
    placefinding: true
}]

However the geocoding never uses our configuration but the standard arcgis-online geocode server. May this be related to the following issue on the basic-viewer-template? https://github.com/Esri/basic-viewer-template/issues/4

Is there any known solution or workaround for this?

glazou commented 8 years ago

Sorry about this, this used to work but following a change in ArcGIS Online the value defined in the config file is always overwritten by the geocoder that you can now configure in ArcGIS Online. If you have an Organization membership, you can add more geocoder through the settings and that's the most simple way.

image

If you don't have an organization membership or prefer to use the configuration file, I started tracked down the issue. It seems to be working after the following changes:

In commonConfig.js, add two attributes singleLineFieldName (this may be different depending on your geocoder) and placefinding

geocode: [{
    url: location.protocol + "//yourgeocoder",
    suggest: true,
    singleLineFieldName: "SingleLine",
    placefinding: true
}]

In app/storymaps/core/Core.js

//if (app.portal.helperServices.geocode && app.portal.helperServices.geocode.length && app.portal.helperServices.geocode[0].url ) 
    //geocodeServices = app.portal.helperServices.geocode;

I will update the issue once we fixed this

EikeLueders commented 8 years ago

Thank you very much for the workaround your mentioned. I managed to implement our gecoder this way and then compile the template myself. Setting the geocoder in the organization is no option for us since we have different geocoders. Each geocoder should be visibile only in one template.