- To use a custom basemap in a deployed application, when you call addCustomBasemap, you must set the value of the 'IsDeployable' name-value pair to true. You must set this name-value pair whether you call addCustomBasemap in your application or outside of your application.
Custom geobasemaps not show in compiled application.
    7 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Peter Valent
 el 6 de Jul. de 2021
  
    
    
    
    
    Respondida: Kelly Luetkemeyer
    
 el 25 de Ag. de 2021
            I have created a simple appdesigner application, which shows some geographic data on top of three types of basemaps. I have some custom basemaps, which I define at the startupFcn. The program runs correctly when run from Matlab, however, the custom maps (2 out of the 3) are not shown when the program is compiled as a standalone application. When changed to default basemaps it works even if it is compiled.
This is how I add the custom basemaps at the startupFcn:
% Add custom basemap 1
name = 'openstreetmap';
url = 'a.tile.openstreetmap.org';
copyright = char(uint8(169));
attribution = copyright + "OpenStreetMap";
addCustomBasemap(name,url,'Attribution',attribution)
% Add custom basemap 2
name = 'opentopomap';
url = 'a.tile.opentopomap.org';
copyright = char(uint8(169));
attribution = copyright + "OpenTopoMap";
addCustomBasemap(name,url,'Attribution',attribution)
The basemap is displayed using the following code:
geobasemap(app.geo_AX,'openstreetmap')
This is the GUI of the app:

How to used cumsom basemaps in standalone desktop apps?
0 comentarios
Respuesta aceptada
  Jan Studnicka
      
 el 7 de Jul. de 2021
        As described here:
0 comentarios
Más respuestas (2)
  Kathleen Holland
 el 24 de Ag. de 2021
        I have a set of map tiles in a local directory, not at a URL.  When I try to do:
addCustomBasemap('myMaps','C:\Users\<userid>\Documents\maps\myMaps','Attribution','me');
I get an error saying 
Warning: Unable to read map tiles from URL
'https://C:\Users\<userid>\Documents\maps\myMaps'. Invalid URL:
How can I install a custom set of map tiles that are resident on my computer?
0 comentarios
  Kelly Luetkemeyer
    
 el 25 de Ag. de 2021
        HI,
You can use a local http server to serve the map tiles.  There are several implementations, such as Apache. You can search the File Exchange for some implementations in MATLAB. Here is one example, Web Server. You could also create your own using Java, Python, or Node. Also, you could even use a Docker container that has a web server. 
The map tiles need to be in a specific folder structure. You can define this structure by using ${row/col/zoom}. For example:
0 comentarios
Ver también
Categorías
				Más información sobre Call C from MATLAB en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



