OSM Scout Offline & Sight Safary Qt Map Plugin
Based on OSM Qt Map Plugin. Uses OSM Scout Server for getting tiles and Sight Safary service for routing.
Usage
- Install the plugin
- Install OSM Scout Oflline service (see below)
- Define
Map
,MapPolyline
,Plugin
,RouteQuery
, andRouteModel
objects like this:
Page {
Map {
id: map
anchors.fill: parent
plugin: mapPlugin
MapPolyline {
id: mapPolylineRoute
line.color: 'green'
line.width: 3
}
Component.onCompleted: {
map.zoomLevel = 14
map.center = QtPositioning.coordinate(55.7542, 37.6221)
mapRouteQuery.addWaypoint(QtPositioning.coordinate(55.7708, 37.5944))
mapRouteQuery.addWaypoint(QtPositioning.coordinate(55.7513, 37.6286))
mapRouteModel.update()
}
}
Plugin {
id: mapPlugin
name: "osmscoutoffline"
}
RouteQuery {
id: mapRouteQuery
}
RouteModel {
id: mapRouteModel
plugin: mapPlugin
query: mapRouteQuery
autoUpdate: false
onRoutesChanged: {
console.log("onRoutesChanged")
mapPolylineRoute.path = mapRouteModel.get(0).path
}
}
}
OSM Scout Offline service
The following steps is actual for Sailfish OS.
In your tasks you can use a pure libosmscout
library.
- Install
OSM Scout Server
- Install
OSM Scout Server Module: Fonts
- Open
OSM Scout Server
application on your phone - Choose a profile recommended for vector and raster tiles
- Download necessary maps
Demo
You can find a working demo which uses this plugin here.