identify (opts) {
        // TODO add full documentation for options parameter

        // TODO consider having a constants area in geoApi / better place for this definition
        const infoMap = {
            'text/html;fgpv=summary': 'HTML',
            'text/html': 'HTML',
            'text/plain': 'Text',
            'application/json': 'EsriFeature'
        };

        // ignore layers with no mime type, not loaded, not visible, not queryable
        if (this.state === shared.states.ERROR ||
            this.state === shared.states.LOADING ||
            this.state === shared.states.NEW ||
            !this.visibility ||
            !this.isQueryable() ||
            !infoMap.hasOwnProperty(this.config.featureInfoMimeType)) {
            // TODO verifiy this is correct result format if layer should be excluded from the identify process
            return { identifyResults: [], identifyPromise: Promise.resolve() };
        }

        const identifyResult = new shared.IdentifyResult(this.getProxy());

        const identifyPromise = this._apiRef.layer.ogc
            .getFeatureInfo(
                this._layer,
                opts.clickEvent,
                this.config.layerEntries.map(le => le.id),
                this.config.featureInfoMimeType)
            .then(data => {
                identifyResult.isLoading = false;

                // TODO: check for French service
                // check if a result is returned by the service. If not, do not add to the array of data
                if (data) {
                    if (typeof data !== 'string') {
                        // likely json or an image
                        identifyResult.data.push(data);
                    } else if (data.indexOf('Search returned no results') === -1 && data !== '') {
                        identifyResult.data.push(data);
                    } 
                }

                // console.info(data);
            });

        return { identifyResults: [identifyResult], identifyPromise };
    }
/**
     * Run a getFeatureInfo on a WMS layer, return the result as a promise.
     * Options:
     * - clickEvent {Object} an event object from the mouse click event, where the user wants to identify.
     *
     * @param {Object} opts     additional arguemets, see above.
     * @returns {Object} an object with identify results array and identify promise resolving when identify is complete; if an empty object is returned, it will be skipped
     */
Run a getFeatureInfo on a WMS layer, return the result as a promise.
Options:
- clickEvent {Object} an event object from the mouse click event, where the user wants to identify.

@param {Object} opts     additional arguemets, see above.
@returns {Object} an object with identify results array and identify promise resolving when identify is complete; if an empty object is returned, it will be skipped
Run a getFeatureInfo on a WMS layer return the result as a promise . Options : - clickEvent { Object } an event object from the mouse click event where the user wants to identify . @param { Object } opts additional arguemets see above . @returns { Object } an object with identify results array and identify promise resolving when identify is complete ; if an empty object is returned it will be skipped
identify (opts) {
        const infoMap = {
            'text/html;fgpv=summary': 'HTML',
            'text/html': 'HTML',
            'text/plain': 'Text',
            'application/json': 'EsriFeature'
        };
        if (this.state === shared.states.ERROR ||
            this.state === shared.states.LOADING ||
            this.state === shared.states.NEW ||
            !this.visibility ||
            !this.isQueryable() ||
            !infoMap.hasOwnProperty(this.config.featureInfoMimeType)) {
            return { identifyResults: [], identifyPromise: Promise.resolve() };
        }
        const identifyResult = new shared.IdentifyResult(this.getProxy());
        const identifyPromise = this._apiRef.layer.ogc
            .getFeatureInfo(
                this._layer,
                opts.clickEvent,
                this.config.layerEntries.map(le => le.id),
                this.config.featureInfoMimeType)
            .then(data => {
                identifyResult.isLoading = false;
                if (data) {
                    if (typeof data !== 'string') {
                        identifyResult.data.push(data);
                    } else if (data.indexOf('Search returned no results') === -1 && data !== '') {
                        identifyResult.data.push(data);
                    } 
                }
            });
        return { identifyResults: [identifyResult], identifyPromise };
    }
identify ( opts ) { const infoMap = { 'text/html;fgpv=summary' : 'HTML' , 'text/html' : 'HTML' , 'text/plain' : 'Text' , 'application/json' : 'EsriFeature' } ; if ( this . state === shared . states . ERROR || this . state === shared . states . LOADING || this . state === shared . states . NEW || ! this . visibility || ! this . isQueryable ( ) || ! infoMap . hasOwnProperty ( this . config . featureInfoMimeType ) ) { return { identifyResults : [ ] , identifyPromise : Promise . resolve ( ) } ; } const identifyResult = new shared . IdentifyResult ( this . getProxy ( ) ) ; const identifyPromise = this . _apiRef . layer . ogc . getFeatureInfo ( this . _layer , opts . clickEvent , this . config . layerEntries . map ( le => le . id ) , this . config . featureInfoMimeType ) . then ( data => { identifyResult . isLoading = false ; if ( data ) { if ( typeof data !== 'string' ) { identifyResult . data . push ( data ) ; } else if ( data . indexOf ( 'Search returned no results' ) === - 1 && data !== '' ) { identifyResult . data . push ( data ) ; } } } ) ; return { identifyResults : [ identifyResult ] , identifyPromise } ; }
Run a getFeatureInfo on a WMS layer, return the result as a promise.
Run a getFeatureInfo on a WMS layer return the result as a promise .
// TODO add full documentation for options parameter // TODO consider having a constants area in geoApi / better place for this definition // ignore layers with no mime type, not loaded, not visible, not queryable // TODO verifiy this is correct result format if layer should be excluded from the identify process // TODO: check for French service // check if a result is returned by the service. If not, do not add to the array of data // likely json or an image // console.info(data);