Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer, select and export #228

Closed
laceysanders opened this issue Sep 26, 2014 · 3 comments
Closed

Buffer, select and export #228

laceysanders opened this issue Sep 26, 2014 · 3 comments

Comments

@laceysanders
Copy link

I'm trying to create a buffer at the users input measurement select polys in the buffer and export to a csv. Is there a possible way to do this in one tool? Also, is there a way to get a URL in a field to be a hyperlink in the popup?

Thanks so much,
Lacey

@jebu75
Copy link
Collaborator

jebu75 commented Sep 26, 2014

I think you can do this pretty easily if I understand you correctly. I've done something similar in one of my apps by building an esri/InfoTemplate in my viewer.js (config file) and passing that as an attribute of my layer's options param.

First, include the dependency in your viewer config:

define([
    'esri/units',
    'esri/geometry/Extent',
    'esri/config',
    'esri/tasks/GeometryService',
    'esri/layers/ImageParameters',
        'esri/InfoTemplate'
], function (units, Extent, esriConfig, GeometryService, ImageParameters, InfoTemplate) {
...
}

Then build the info template. I do this just below where the imageParameters are set up:

var myInfoTemplate = new InfoTemplate();
    myInfoTemplate.setTitle( 'Info Template With Link' );
    myInfoTemplate.setContent( '<a href="{my_field_with_link}" target="_blank">Open in new window</a>' );

Then assign the info template to your layer. Here's an example for a feature layer:

operationalLayers: [{
            type: 'feature',
            url: 'http://services1.arcgis.com/g2TonOxuRkIqSOFx/arcgis/rest/services/MeetUpHomeTowns/FeatureServer/0',
            title: 'STLJS Meetup Home Towns',
            options: {
                id: 'meetupHometowns',
                opacity: 1.0,
                visible: true,
                outFields: ['*'],
                mode: 0,
                infoTemplate: myInfoTemplate
            },
            editorLayerInfos: {
                disableGeometryUpdate: false
            }
        },

...

If you are using a dynamic layer, you will need to pass as an object with the layer id as the property name

{
            type: 'dynamic',
            url:  'http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer',
            title: 'Damage Assessment',
            slider: true,
            noLegend: false,
            collapsed: false,
            options: {
                id: 'DamageAssessment',
                opacity: 1.0,
                visible: true,
                                // '1' is the id of the layer in my service I want the info template on.
                imageParameters: { 1: imageParameters }
            },
            layerControlLayerInfos: {
                swipe: true
            }
        }

Hope this helps.

@tmcgee
Copy link
Member

tmcgee commented Sep 26, 2014

Regarding the hyperlink, issue #212 has a few additional examples on how to create the hyperlink in the infoWindow.

Regarding your first question about buffer/export, there isn't a process for that in version 1.3.0. There is a set of widgets to support this workflow coming soon.

@laceysanders
Copy link
Author

Thank you both for your responses. I will be using those as guides for the URL in the infoWindow. It's exciting to hear that a buffer, select and export tool is in the making, in the meantime is there a way to add only a buffer to app? Thanks again, Lacey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants