Qt location MapboxGL qml Plugin+ OpenWeatherMap map Tiles



  • hello everyone, i'm using Qt MapboxGL maps with QML to deploy my application. I wanted to add OpenWeatherMaps temperature map layer to my original one using that guide OpenWeatherMap layers Api. but the problem is that i cant load it into my QML. i used Maputnik editor to edit my json file then add it as a mapbox style. the result was great in the editor, but not on my application. can anyone help me to resolve this problem please. 0_1525452369739_Screenshot_2018-05-03_12-31-441.png
    Here is my Code```

        Map {id: map
        anchors.fill: parent
        zoomLevel: 3
        minimumZoomLevel: 2
        maximumZoomLevel:30
        tilt: tiltValue
        
        plugin: Plugin {
            id: mapboxglPlugin
            name: "mapboxgl"
            
            PluginParameter { name: "mapboxgl.access_token"; value: "ACCESS_TOKEN_VALUE" }
            //        PluginParameter { name: "mapbox.map_id"; value: "styles/bayou020/cj9v21si54gk52st7ivz9ywui" }
            PluginParameter { name: "mapboxgl.mapping.additional_style_urls"; value: "mapbox://styles/bayou020/cj9v21si54gk52st7ivz9ywui" }
            
            PluginParameter {
                name: "mapboxgl.mapping.items.insert_before"
                value: "aerialway"
            }
            
            
        }
        
        
    
    
                MapParameter {
                    id: source
                    type: "source"
        
                    property var name: "weatherSource"
                    property var tiles: "https://tile.openweathermap.org/map/clouds_new/{z}/{x}/{y}.png?appid=APP_ID"
                    property var sourceType: "raster"
                    property var tileSize: 256
                    property var scheme: "xyz"
                    property var minzoom: 4.0
                    property var maxzoom: 20.0
    
                }
        
        
                MapParameter {
                    type: "layer"
        
                    property var name: "wind_weather"
                    property var layerType: "raster"
                    property var source: "weatherSource"
    
                          }}
    

    ,,,
    and my modified Json file

     
     "sources": {
        "composite": {
          "url": "mapbox://mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v7",
          "type": "vector"
        },
        "weather": {
          "type": "raster",
          "tiles": [
            "https://tile.openweathermap.org/map/temp_new/{z}/{x}/{y}.png?appid=APP_ID"
          ],
          "minzoom":2,
          "maxzoom": 20,
    "tileSize": 256
        }
      },
      "sprite": "mapbox://sprites/bayou020/cjgpxncmv00012spcjdwidvxy",
      "glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
      "layers": [
            {
          "id": "clouds",
          "type": "raster",
          "source": "weather"
    
        }
      ],
    

    [edit: Removed sensitive information SGaist]



  • @Pilot-Rockstar just in case, you may want to avoid posting "valid" API keys so widely...



  • This post is deleted!

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.