tmcgee / cmv-widgets

Widgets for CMV, the Configurable Map Viewer.
https://cmv.io/
MIT License
38 stars 48 forks source link

How to configure find.js to be able to find in a featureServer? #209

Closed GilbertLasnier closed 5 years ago

GilbertLasnier commented 5 years ago

Hello Tim I hope your go well! Its work with mapserver service: https://gis.icao.int/ArcGIS/rest/services/montreal/MapServer but it doesn't work with: https://services5.arcgis.com/DG8BiFFElpMESqG2/arcgis/rest/services/Map_of_Montreal_Interactive/FeatureServer/5?token=ljA7D5P1l5 etc Do you have any suggestion or the feature services is not supported? This my code from your latest CMV version... /eslint no-console: 0, no-alert: 0/ define([ 'dojo/i18n!./nls/main' ], function (i18n) {

return {
    map: true,
    zoomExtentFactor: 2,
    queries: [
        {
            description: i18n.find.louisvillePubSafety,
            url: 'https://gis.icao.int/ArcGIS/rest/services/montreal/MapServer',
            layerIds: [0, 1, 2, 3, 4, 5, 6, 7, 8],
            searchFields: ['CASERNE', 'NO_CIVIQUE', 'RUE'],
            minChars: 2,
            gridColumns: [
                {
                    field: 'CASERNE',
                    label: 'CASERNE'
                },
                {
                    field: 'layerName',
                    label: 'Layer',
                    width: 100,
                    sortable: false,
                    resizable: false
                }
            ],
            sort: [
                {
                    attribute: 'CASERNE',
                    descending: false
                }
            ],
            prompt: 'CASERNE, NO_CIVIQUE, RUE',
            selectionMode: 'single'
        },
        {
            description: i18n.find.sf311Incidents,
            url: 'https://services5.arcgis.com/DG8BiFFElpMESqG2/arcgis/rest/services/Map_of_Montreal_Interactive/FeatureServer/5?token=ljA7D5P1l5oYqX8Yb2KYzTC8tgdKYfgXi6ZrYtVl1vd9e-IIt5DpnA7WM1o6mPFvzqC0K6pckr5lgqdPfvtMhb8bLB3QOJ522algfGbqsVFOgwscT-KelZTxq_jotbEgqPIvsEJjzPp3CnDiknfj7zqAEGCtnMZHr3K9QbwbaAV0KxpnFM2JX_b_OZQ222KHt1SdF9uK2QIBPcUanMvqmcF0L0Ph7pJlfCwC5rDy0vw.',
            layerIds: [5],
            searchFields: ['CIVIQUE_DE'],
            minChars: 4,
            gridColumns: [
                {
                    field: 'CIVIQUE_DE',
                    label: 'CIVIQUE_DE'
                },

                {
                    field: 'layerName',
                    label: 'layer',
                    width: 100,
                    sortable: false,
                    resizable: false
                }

            ],
            sort: [
                {
                    attribute: 'CIVIQUE_DE',
                    descending: false
                }
            ],
            prompt: 'Numero CIVIQUE',
            selectionMode: 'single'
        },
    ],
    selectionSymbols: {
        polygon: {
            type: 'esriSFS',
            style: 'esriSFSSolid',
            color: [255, 0, 0, 62],
            outline: {
                type: 'esriSLS',
                style: 'esriSLSSolid',
                color: [255, 0, 0, 255],
                width: 3
            }
        },
        point: {
            type: 'esriSMS',
            style: 'esriSMSCircle',
            size: 25,
            color: [255, 0, 0, 62],
            angle: 0,
            xoffset: 0,
            yoffset: 0,
            outline: {
                type: 'esriSLS',
                style: 'esriSLSSolid',
                color: [255, 0, 0, 255],
                width: 2
            }
        }
    },
    selectionMode: 'extended'
};

});

tmcgee commented 5 years ago

The Find Operation of the Esri REST API only supports MapServices.

GilbertLasnier commented 5 years ago

Thanks for your fast anwser….

From: Tim McGee [mailto:notifications@github.com] Sent: 31-May-19 3:37 PM To: tmcgee/cmv-widgets Cc: Lasnier, Gilbert; Author Subject: Re: [tmcgee/cmv-widgets] How to configure find.js to be able to find in a featureServer? (#209)

The Find Operationhttps://developers.arcgis.com/rest/services-reference/find.htm of the Esri REST API only supports MapServices.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/tmcgee/cmv-widgets/issues/209?email_source=notifications&email_token=ABTYMA6WUPYHVHES7LJF4TDPYF46BA5CNFSM4HR4VV7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWWF32Q#issuecomment-497835498, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABTYMAZTWCXQTTH5GD4F263PYF46BANCNFSM4HR4VV7A.