mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	mapwidget.qml: simplify the map type enumeration into "mapType"
Make the "enumeration" local to the Map object for now. This will possibly break if another plugin is used in place of the ESRI plugin, but it will simplify the map toggle button which is about to be implemented next. If support for multiple plugins is added on runtime a simple helper function will be needed that will check the current plugin "name". And return the appropriate supportedMapTypes[X] for e.g. STREET of that plugin. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
		
							parent
							
								
									8b22435809
								
							
						
					
					
						commit
						468f3b57c0
					
				
					 1 changed files with 2 additions and 3 deletions
				
			
		|  | @ -5,8 +5,6 @@ import QtPositioning 5.3 | ||||||
| import org.subsurfacedivelog.mobile 1.0 | import org.subsurfacedivelog.mobile 1.0 | ||||||
| 
 | 
 | ||||||
| Item { | Item { | ||||||
| 	readonly property var esriMapTypeIndexes: { "STREET": 0, "SATELLITE": 1 } |  | ||||||
| 
 |  | ||||||
| 	Plugin { | 	Plugin { | ||||||
| 		id: mapPlugin | 		id: mapPlugin | ||||||
| 		name: "esri" | 		name: "esri" | ||||||
|  | @ -23,6 +21,7 @@ Item { | ||||||
| 		plugin: mapPlugin | 		plugin: mapPlugin | ||||||
| 		zoomLevel: 1 | 		zoomLevel: 1 | ||||||
| 
 | 
 | ||||||
|  | 		readonly property var mapType: { "STREET": supportedMapTypes[0], "SATELLITE": supportedMapTypes[1] } | ||||||
| 		readonly property var defaultCenter: QtPositioning.coordinate(0, 0) | 		readonly property var defaultCenter: QtPositioning.coordinate(0, 0) | ||||||
| 		readonly property var defaultZoomIn: 17.0 | 		readonly property var defaultZoomIn: 17.0 | ||||||
| 		readonly property var defaultZoomOut: 1.0 | 		readonly property var defaultZoomOut: 1.0 | ||||||
|  | @ -30,7 +29,7 @@ Item { | ||||||
| 		property var newZoom: 1.0 | 		property var newZoom: 1.0 | ||||||
| 
 | 
 | ||||||
| 		Component.onCompleted: { | 		Component.onCompleted: { | ||||||
| 			activeMapType = supportedMapTypes[esriMapTypeIndexes.SATELLITE] | 			activeMapType = mapType.SATELLITE | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		MapItemView { | 		MapItemView { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue