[Geomoose-users] Geomoose services language change

Christopher Hughes chughes at co.lincoln.or.us
Tue Apr 28 11:37:46 PDT 2020


I'm assuming you're trying to do this in GeoMoose 3.

For search, my best guess would be in dist/services/search.js.
You do have some ability to override the labels in your app.js file without
having to modify the source files.

For example, I've changed the default title of the search tool, as well as
the results, when I declared my search service:

        app.registerService('search-Taxlots-simple', SearchService, {
            // The input fields are defined only using one field
            title: 'Simple Taxlot Search',
            resultsTitle: 'Taxlots Search Results',
            fields: [
                {type: 'text', label: 'Simple Search', name: 'TERM'},
            ],
            prepareFields: function (fields) {
                // this pulls out the term from the search
                const searchTerm = fields[0].value;
                // this is the list of fields in the layer which will
be searched.
                const searchFields = ['OwnName', 'SitusAll',
'ParcelID', 'PropertyId', 'Address1'];
                // this switched to matching any field
                var query = ['or'];
                for(var i = 0, ii = searchFields.length; i < ii; i++) {
                    query.push({
                        comparitor: 'ilike',
                        name: searchFields[i],
                        value: '%' + searchTerm + '%'
                    });
                }
                return [query];
            },
            searchLayers: ['Taxlots_selection-wfs/Taxlots_selection'],
            validateFieldValues: function (fields) {
                let nonEmpty = 0;
                const validateFieldValuesResult = {
                    valid: true,
                    message: null
                };

                if (fields['TERM'] !== undefined && fields['TERM'] !== '') {
                        nonEmpty++;
                }

                if (nonEmpty === 0) {
                    validateFieldValuesResult.valid = false;
                    validateFieldValuesResult.message = 'Please
complete at least one field.'
                }
                return validateFieldValuesResult;
            }
        });




Hope this helps,

Chris








On Tue, Apr 28, 2020 at 10:37 AM <topografia at oliva.es> wrote:

> I would like to change the language of the pop-up services. Specially
> "print" and "search" services....I've allready changed the toolbar tabs
> language...but I don't find the source files where change the label
> language of the services. I've found the services print and serach under
> the folders "idst" and "src" under the geomoose folder....which one do I
> have to vhange? or none of those ones? Thanks.
>
> --
> <http://oliva.es/es/>
> *Cap del Departament de Cartografia i Topografia*
> Lara Perez Bessone
> Enginyera Tecnica Topografa Municipal
> email: topografia at oliva.es Tel. mòvil: 647 835 086 ext. 521
>
>
> *Ajuntament d'Oliva - València*
> Plaça del Ajuntament 1, 46780 Oliva
> Tel. 962850250 Fax 962855165 www.oliva.es
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geomoose-users



-- 
Chris Hughes

GIS Analyst
Lincoln County Surveyor Department
880 NE 7th St. l Newport, OR 97365
Tel: (541) 574 1283
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20200428/6e45ad42/attachment-0001.html>


More information about the Geomoose-users mailing list