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: 75
Registered: ‎02-19-2019

M.App Enterprise Mobile App Background Map Change

Hi All,

 

How can change my mobile Apps background Map. I have a WMTS map cache that I'm using on Desktop and Browser background Map. I need same map cache on Mobile Apps background. By default microsoft map is loading. 

 

http://xxxxx.com/mapcache/wmts/?request=GetCapabilities&Service=WMTS

How can I change with my own background map?

 

Thanks,

Liton

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

Re: M.App Enterprise Mobile App Background Map Change

[ Edited ]

Hi Liton,

 

Native layers are configured in the map.xaml of the Mobile M.App.

The background map is set with NativeLayer, but you can choose to not have a NativeLayer and use a UrlTileOverlay in a case like what you describe.

 

Here is example of using the NativeLayer. In the Mobile M.App the 'Roads' layer will be the background map. You can see that I also have a WMS layer defined here so users can toggle on/off these layers in Mobile M.App

<NativeMap.Layers>
		<MarkerVectorLayer Entity="Locations" Icon="Map.Pin.png"  ZIndex="3" MinimumZoomLevel="13" MaximumZoomLevel="22">
			<FeatureInfo Title="Name: @{name}" Detail="Description: @{description}">
				<NavigateShellAction Icon="Edit" Target="LocationForm">
					<Parameter Name="Id" Value="@{id}" />
				</NavigateShellAction>
			</FeatureInfo>
		</MarkerVectorLayer>
		<NativeLayer Type="Roads" />
		<TileLayer TileRef="WMS" IsActive="True" />
	</NativeMap.Layers>

To remove the NativeLayer 'Roads' leaving behind the 'WMS' as the background Map I simply remove it from the .xaml for the Map and rezip the files uploading the new shell. The <TileLayer> now serves as the background Map.

<NativeMap.Layers>
		<MarkerVectorLayer Entity="Locations" Icon="Map.Pin.png"  ZIndex="3" MinimumZoomLevel="13" MaximumZoomLevel="22">
			<FeatureInfo Title="Name: @{name}" Detail="Description: @{description}">
				<NavigateShellAction Icon="Edit" Target="LocationForm">
					<Parameter Name="Id" Value="@{id}" />
				</NavigateShellAction>
			</FeatureInfo>
		</MarkerVectorLayer>
		<TileLayer TileRef="WMS" IsActive="True" />
	</NativeMap.Layers>

You can find this information on setting Tiles in your Shell in the Mobile Documentation.

 

HTH

Highlighted
Contributor
Posts: 75
Registered: ‎02-19-2019

Re: M.App Enterprise Mobile App Background Map Change

[ Edited ]

Hi ,

 

Thank you so much for your reply. I have added code but not working. Please see my code below. WMTS

Nativemap.xaml

	<NativeMap.Layers>
		<MarkerVectorLayer Entity="Roads" Icon="Map.Pin.png"  ZIndex="3" MinimumZoomLevel="13" MaximumZoomLevel="22">
			<FeatureInfo Title="Name: @{name}" Detail="Description: @{description}">
				<NavigateShellAction Icon="Edit" Target="RoadForm">
					<Parameter Name="Id" Value="@{id}" />
				</NavigateShellAction>
			</FeatureInfo>
		</MarkerVectorLayer>
		<TileLayer TileRef="WMTS" IsActive="True" />
	</NativeMap.Layers>

I have this code in the Shell.xaml

	<Shell.Tiles>
  <UrlTileOverlay Id="wmts" TileWidth="256" TileHeight="256" MinimumZoomLevel="0" MaximumZoomLevel="20"
                  Url="http://xxxxx/mapcache/wmts/?request=GetCapabilities&Service=WMTS" />
</Shell.Tiles>

I'm getting error 

'=' is an unexpected error token. The expected token is ';' Line 71, position 98

 

Thanks,

Liton

Highlighted
Contributor
Posts: 75
Registered: ‎02-19-2019

Re: M.App Enterprise Mobile App Background Map Change

 

I use this code and background is coming black. What will be the link for this wmts service

http://dubniemcache1-v:8081/mapcache/wmts/?request=GetCapabilities&Service=WMTS ?

	<Shell.Tiles>
  <UrlTileOverlay Id="wmts" TileWidth="256" TileHeight="256" MinimumZoomLevel="0" MaximumZoomLevel="20"
                  Url="http://dubniemcache1-v:8081/erdas-iws/ogc/wmts/NIE?SERVICE=WMTS&amp;REQUEST=GetTile&amp;VERSION=1.0.0&amp;LAYER=Poles&amp;STYLE=default&amp;FORMAT=image/jpeg&amp;TILEMATRIXSET=OGC:1.0:GoogleMapsCompatible&amp;TILEMATRIX={z}&amp;TILEROW={y}&amp;TILECOL={x}" />
</Shell.Tiles>

MapBackgrund.png

Thanks,

Liton

Highlighted
Contributor
Posts: 75
Registered: ‎02-19-2019

Re: M.App Enterprise Mobile App Background Map Change

This is my latest code but still not working , showing blue backgound 

NativeMap.xaml

 

	<NativeMap.Layers>
		<MarkerVectorLayer Entity="Roads" Icon="Map.Pin.png"  ZIndex="3" MinimumZoomLevel="13" MaximumZoomLevel="22">
			<FeatureInfo Title="Name: @{name}" Detail="Description: @{description}">
				<NavigateShellAction Icon="Edit" Target="RoadForm">
					<Parameter Name="Id" Value="@{id}" />
				</NavigateShellAction>
			</FeatureInfo>
		</MarkerVectorLayer>
		<TileLayer TileRef="WMTS" IsActive="True" />
	</NativeMap.Layers>

Shell.xaml

<Shell.Tiles>
  <UrlTileOverlay Id="wmts" TileWidth="256" TileHeight="256" MinimumZoomLevel="0" MaximumZoomLevel="20"
                  Url="http://dubniemcache1-v:8081/mapcache/wmts/?request=GetCapabilities&amp;Service=WMTS" />
</Shell.Tiles>

blue background on the map but same cache server is working fine on Desktop and browser App. 

 

Blue background.png

 

I have tried lot of way but not luck yet. 

 

Thanks,

Liton

 

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

Re: M.App Enterprise Mobile App Background Map Change

Liton,

 

I cant get to your GetCapabilities but UrlTileOverlay 'ID' in shell should match the TileLayer 'TileRef' in the Map.xaml

As well the 'Url' in 'Shell.Tiles' is not enough to have getcapabilities to the WMTS

You had previously a better example but generally it should follow:

 

http://server_name/erdas-iws/ogc/wmts/tenant_name?SERVICE=WMTS&amp;VERSION=1.0.0&amp;REQUEST=GetTile&amp;STYLE=default&amp;LAYER=layername&amp;FORMAT=image/png&amp;TILEMATRIXSET=OGC:1.0:GoogleMapsCompatible&amp;TILEMATRIX={z}&amp;TILEROW={y}&amp;TILECOL={x}

HTH

Highlighted
Contributor
Posts: 75
Registered: ‎02-19-2019

Re: M.App Enterprise Mobile App Background Map Change

Hi Stephen,

 

Thank you so much for your reply.

 

I did same exactly what you suggested but still black background. Please see my code. 

NativeMap.xaml

<TileLayer TileRef="wmts" IsActive="True" />

Shell.xaml

<Shell.Tiles>
  <UrlTileOverlay Id="wmts" TileWidth="256" TileHeight="256" MinimumZoomLevel="0" MaximumZoomLevel="20"					
                  Url="http://dubniemcache1-v:8081/erdas-iws/ogc/wmts/NIE?SERVICE=WMTS&amp;VERSION=1.0.0&amp;REQUEST=GetTile&amp;STYLE=default&amp;LAYER=Poles&amp;FORMAT=image/png&amp;TILEMATRIXSET=OGC:1.0:GoogleMapsCompatible&amp;TILEMATRIX={z}&amp;TILEROW={y}&amp;TILECOL={x}" />
</Shell.Tiles>

Server= http://dubniemcache1-v:8081

Tenant name= NIE

LAYER=Poles

 

MapBackgrund.png

 

Desktop background map is population from the below link and please see geoservice configuration for desktop apps

http://dubniemcache1-v:8081/mapcache/wmts/?request=GetCapabilities&Service=WMTS

MapGenie.png

 

But on mobile Apps not loading with my Map cache. 

 

Thanks,
Liton

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

Re: M.App Enterprise Mobile App Background Map Change

Liton,

 

Please check your TileMatrixSet. In the URL it states 'OGC:1.0:GoogleMapsCompatible' yet in the screenshot you give it is set to 'IRISHGRIDPublicMaps'

 

Is the WMTS in EPSG 3857? Configuration of tile sources for map views (WMTS, WMS and TMS). Projection must be EPSG:3857.

 

Otherwise I dont see any issues with what you present here.

 

HTH

Highlighted
Contributor
Posts: 75
Registered: ‎02-19-2019

Re: M.App Enterprise Mobile App Background Map Change

Hi Stefano,

 

Thank you for your reply. 

 

My WMTS in EPSG 29903 , I have changed the url (TILEMATRIXSET=IrishGRIDPublicMaps and LAYER=GNIS_MAP) but still same black background. 

 

Url="http://dubniemcache1-v:8081/erdas-iws/ogc/wmts/NIE?SERVICE=WMTS&amp;VERSION=1.0.0&amp;REQUEST=GetTile&amp;STYLE=default&amp;LAYER=GNIS_MAP&amp;FORMAT=image/png&amp;TILEMATRIXSET=IrishGRIDPublicMaps&amp;TILEMATRIX={z}&amp;TILEROW={y}&amp;TILECOL={x}" />

Thanks,
Liton

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

Re: M.App Enterprise Mobile App Background Map Change

Liton,

 

Please review the Mobile Documentation I referenced in my original reply to this topic.

Configuration of tile sources for map views (WMTS, WMS and TMS) must have a  projection of EPSG:3857. It is stated in that documentation clearly as a 'must have' for these tile sources.