-
Notifications
You must be signed in to change notification settings - Fork 3
Map
guillaume charbonnier edited this page Mar 9, 2019
·
7 revisions
| 😅 (difficulty) | ⌛ (time-Box) | 🔗 (related to) |
|---|---|---|
| 1️⃣ / 5️⃣ | 60 - 90 mn | Location, Location |
Get to know all about maps in QML :
- control the map : type, center position, zoom
- add all type of marker elements to the map
- query the map services about specific element
- ..
- Select a location services provider
- Add a map
- Set the map to the device current position
- control the map properties : tilt, rotation, zoom level
- change the map type
- position a filled cercle at a given location : try to set a fixed "world" size (i.e 100m) or a fixed screen size.
- when clicking on the map, an image item should be set related to the position corresponding to the mouse clik (for instance 250m to the east)
- Dynamical creation of marker (as a rectangle, an image or anything else you want) : each time one click on the map a marker is created, when clicking on an existing marker it gets deleted
Warning : Spoilers !!!
| QML types | Module | Useful for... |
|---|---|---|
| Plugin | Location | service provider : "osm", "here","esri"... |
| Map | Location | Display a map using a given plugin |
| PositionSource | Positioning | give your position |
| MapCircle | Location | A circle marker to position on your map |
| MapQuickItem | Location | A map container to position any item on your map |
| MapItemView | Location | A view to position items on your map |
| GeocodeModel | Location | will give you the coordinate of an address |
| PlaceSearchModel | Location | A geo queryable model providing items matching your searchTerm in the given searchArea |
| RouteQuery RouteModel | Location | create a navigation query |
- use QtPositioning.coordinate to create a coordinate object from a given position
- use atDistanceAndAzimuth to create a coordinate relative to another
- use supportedMapTypes property to get the list of map type supported and activeMapType to select :
activeMapType = supportedMapTypes[0] - XmlListModel is very handy to display the content of a georss.
XmlListModel
{
id:bikeModel
source: "https://www.capitalbikeshare.com/data/stations/bikeStations.xml"
query: "/stations/station"
XmlRole { name: "latitude"; query: "lat/string()"; isKey: true }
XmlRole { name: "longitude"; query: "long/string()"; isKey: true }
}- check services provider limitations about free plan / features
- place a picture for every restaurants around us within 2km
- Geocode/reverse geocode each time a marker is clicked, display its address and position
- display the navigation from your current position to a selected POI
- Show the unesco world heritage on a map, for every entry display the picture and the description