Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How do one change/add layers using qml and openstreetmap (osm)?
Qt 6.11 is out! See what's new in the release blog

How do one change/add layers using qml and openstreetmap (osm)?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qml osm
1 Posts 1 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SteinarK
    wrote on last edited by
    #1

    Question from a newb: Is it possible to change or add layers using osm map?

    My current code:

            Plugin {
                id: osmPlugin
                name: "osm"
                PluginParameter { name: "osm.useragent"; value: "My great Qt OSM application" }
                PluginParameter { name: "osm.mapping.host"; value: "http://osm.tile.server.address/" }
                PluginParameter { name: "osm.mapping.copyright"; value: "All mine" }
                PluginParameter { name: "osm.routing.host"; value: "http://osrm.server.address/viaroute" }
                PluginParameter { name: "osm.geocoding.host"; value: "http://geocoding.server.address" }
            }
            
            Map {
                id: map
                plugin: osmPlugin
                anchors.fill: parent
                zoomLevel: 14
                
                gesture.enabled : true
                center {
                    // Rudskogen racetrack
                    latitude: 59.3680
                    longitude: 11.25
                }
            }
    
    

    Produced output:
    link to image

    Would like to have the output as:
    link to image

    To me it seem like the produced and wanted output can be switched to by changing layers as seen in

    http://www.openstreetmap.org/export#map=16/59.3665/11.2606

    by switching between "MapQuest open" and "Standard" map layers.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved