Skip to content
guillaume charbonnier edited this page Mar 6, 2019 · 7 revisions

Map

topicmap
😅 (difficulty) ⌛ (time-Box) 🔗 (related to)
1️⃣ / 5️⃣ 60 - 90 mn Location, Location

✔️ primary objectives

:suspect: Peace of cake

  • Select a location services provider
  • Add a map

:rage1: Easy

  • 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.

:rage3: Normal

  • 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

💰 useful ressources

👶 Newbies area

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

ℹ️ useful information and hints

  • 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 }
    }

⚠️ cautions and warnings

  • check services provider limitations about free plan / features

secondary objectives (only for the braves 🏆 )

:rage4: very difficult

  • place a picture for every restaurants around us within 2km
  • Geocode/reverse geocode each time a marker is clicked, display its address and position

:goberserk: Nightmare

  • display the navigation from your current position to a selected POI

:godmode: God mode

  • Show the unesco world heritage on a map, for every entry display the picture and the description

Clone this wiki locally