Hexagon Geospatial
MENU

Mobile

Need help in setting and configuring Mobile MapWorks or just looking for general information you can’t find anywhere else. The Mobile discussion board is where you can look for answers, ask those questions and help others by sharing your knowledge. Help build a strong Mobile Community and join in on the discussions.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Regular Contributor
Posts: 185
Registered: ‎08-10-2016
Accepted Solution

WFS Search results in Mobile MapWorks Advantage

WFS Search in Mobile MapWorks returning search results from id field only as shown..

 

mmwsearch.jpg

 

How do i make it return values from a different field e.g from the stationnam field. Below is the featuresource ,searchable, dataset and featuretype definitions.

 

{
"id":"CMS-Stations-search-Layer",
"type":"wfsFeatureType",
"primaryKeyFieldName":"id",
"featurePrefix":"Demo",
"typeName":{
"localName":"CMS_StationNames",
"namespace":"http://192.168.1.231:8282/geoserver/demo"
},
"service":"e296ff10-7ed3-4c6b-a86e-f513893e4b4d",
"geometryFieldName":"geom",
"geometryType":"Point",
"featureTypeMetadata":{
"crudPermissions":{
"isCreatePermitted":false,
"isUpdatePermitted":false,
"isDeletePermitted":false
},
"attributesMetadata":{
"stationnam":{
"title":"Station Name:",
"type":"text",
"isReadOnly":true
}
}
}
},

 

 
"searchables": [      
        {
            "id": "searchable_CMS",
            "name": "StationNames",
            "dataset": "CMS-Stations-search-dataset",
            "anyTextSupport": false,
            "anyTextProperties": [ "stationnam" ]
            
        }
    ]
{
            "id":"CMS-Stations-search-dataset",
            "sources":[
                "CMS-Stations-search-Layer"
            ]
}
{
                    "title":"StationNames",
                    "name":{
                        "localName":"CMS_StationNames",
                        "namespace":"http://192.168.1.231:8282/geoserver/demo"
                    },
                    "outputFormats":[
                        "text/xml; subtype=gml/3.1.1"
                    ],
                    "defaultCrs":"EPSG:3857"
 }
Technical Evangelist
Posts: 184
Registered: ‎07-30-2015

Re: WFS Search results in Mobile MapWorks Advantage

Hi,

 

Do you use the app from the store? Or do you buid the app using the Mobile SDK?

Regular Contributor
Posts: 185
Registered: ‎08-10-2016

Re: WFS Search results in Mobile MapWorks Advantage

Hi

 

Am using version 16.3.0 (663) of the app from Hockey App. I have also tested with an SDK version and still got the same results.

 

My WFS is from geoserver so am not sure if this could also be a factor.

Technical Evangelist
Posts: 184
Registered: ‎07-30-2015

Re: WFS Search results in Mobile MapWorks Advantage

No, it has nothing todo with the GeoServer.

 

Current mechanism by deafault searches for an attribute named "Title", if it doesn't find it, it sorts the feature attrbutes alphabetically and picks the first one. The latter is your case.

If you have access to the service configuration, you could modify the returned attributes accordingly.

 

Unfortuntelly, it isn't configurable, but you can change it in your app.

In src/resources/templates there is a default.resultlist.tmpl file. You may edit it and change Title for the required property name.

 

We should make it configurable in the near future, till then you can use on the options.

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.