M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 67
Registered: ‎11-15-2018
Accepted Solution

Mobile App - different marker depending on a field

Hello,
we are looking for a solution to show different marker in map due to values of one column in our table.
In the following documentation there is a hint: "Add a marker vector layer with an icon depending on a field"
https://community.hexagongeospatial.com/t5/M-App-Enterprise-Tutorials/M-App-Enterprise-Mobile-Docume...

So we configured the following:

 

<MarkerVectorLayer Entity="Hydranten" MinimumZoomLevel="5" MaximumZoomLevel="20" Icon="Typ">
...
</MarkerVectorLayer>

 

 

"Typ" is a column in table "Hydranten" which has two values "OFH" and "UFH", so we expected two different marker,
but we still got one marker (red circle with white button).

 

What is missing/wrong?

Can we also design our own marker and where do we have to store these self designed marker for "Typ"?

 

Thanks a lot,
regards Iris

Highlighted
Technical Evangelist
Posts: 802
Registered: ‎11-12-2015

Re: Mobile App - different marker depending on a field

[ Edited ]

Hi Iris,

 

As per the documentation you reference, a folder 'Icons' is expected in the shell folder if using custom Icons. If you wish to base this Icon on an attribute value then whatever attribute value you have should have a named .png. Additionally, as per the documentation, there should be a @2x, @3x and @4x .png as well.

 

Here I have a Crime feature with 5 possible values, but I wish to display in this example only those with attribute (RUCR_EXT_D) value of 'ASSAULT' with a custom icon.

 

Map.xaml

<MarkerVectorLayer Entity="Crime_ent" Icon="RUCR_EXT_D" ZIndex="0" MinimumZoomLevel="12" MaximumZoomLevel="20">
			<FeatureInfo Title="Crime Report" Detail="@{RUCR_EXT_D}">
                <NavigateShellAction Icon="Edit" Target="CrimeForm">
                    <Parameter Name="Id" Value="@{Guid}" />
                </NavigateShellAction>
                <NavigateSelectionAction/>
				<NavigateCarSelectionAction/>
            </FeatureInfo>
		</MarkerVectorLayer>

Shell folder for 'HalifaxMobile' M.App and content of Icons folder

iconfieldbased.PNG

Map result showing that the 'ASSAULT' features are displayed using the custom icon chosen while all other values recieve the default circle.

mapresult.PNG

 

In your case the Icons folder should be added and separate icons names for the attrribute values you have for 'Typ' ie. OFH, UFH

 

HTH

 

Highlighted
Contributor
Posts: 67
Registered: ‎11-15-2018

Re: Mobile App - different marker depending on a field

Thank you very much, it works fine!

Regards Iris