Forums

OverviewV-Play 2 Support (Qt 5) › MapQuest OSM mapping direct tile access discontinued – how to setup AppKey

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #15422

    Günther
    V-Play Team

    Hi!

    I’m not sure if the map-viewer example is really good starting point as it already has a lot of logic just for showcasing different plugins and features. The mapviewer application is also simple Qt Quick App and not a V-Play App (the V-Play SDK is not included and not used).

    For a first simple maps example with V-Play that you can build upon, please try creating a new project based on our maps template. For this, open Qt Creator, click “New Project” in the Welcome-tab and choose “V-Play Apps – Maps Application”. Then simply enter your mapbox.map_id and mapbox.access_token as the value for the Plugin { parameters: […] }.

    For a first runnable example, you can also use these demo settings:

        AppMap {
          anchors.fill: parent
    
          // configure plugin for displaying map here
          // see http://doc.qt.io/qt-5/qtlocation-index.html#plugin-references-and-parameters
          // for a documentation of possible Location Plugins
          plugin: Plugin {
            name: "mapbox"
            // configure your own map_id and access_token here
            parameters: [  PluginParameter {
                name: "mapbox.map_id"
                value: "mapbox.streets"
              },
              PluginParameter {
                name: "mapbox.access_token"
                value: "pk.eyJ1IjoiZ3R2cGxheSIsImEiOiJjaWZ0Y2pkM2cwMXZqdWVsenJhcGZ3ZDl5In0.6xMVtyc0CkYNYup76iMVNQ"
              }]
          }
    
          // Center map to Vienna, AT
          center: QtPositioning.coordinate(48.208417, 16.372472)
          zoomLevel: 13
        }

    The mapbox.streets map_id uses the default look by mapbox. Please replace the access token with your custom one. Just for a first test you can use the token from above, but we may replace or deactivate it anytime as it is just a dummy-token for our snippets/examples.

    Best,
    Günther

    #15432

    h20delirious

    ok then I’ll create my first maps application using v-play but can you please guide me to do so, as because as stated on opening qt creator there is no “V-Play Apps – Maps Application” option in my case.

    So would you please list down the step by step process of running the above said example in qt 5.7.

     

    #15435

    Günther
    V-Play Team

    When installing V-Play with our installer, the New Project Templates for V-Play should be automatically added and available in Qt Creator.
    If they are missing, you can also go to to the directory <V-PlaySDK>/Examples/V-Play/appdemos/maps to find a sample maps V-Play project to start with.
    Just open the project in Qt Creator and hit run to compile and start the app.

    You can also replace the code in MapsMain.qml with one of the simple snippets I mentioned above. The snippets can also be found in <V-PlaySDK/Examples/V-Play/appexamples/maps. E.g. copy the code from appexamples/maps/MapsApp.qml and replace the code in appdemos/maps/qml/MapsMain.qml.

    Best,
    Günther

     

     

    #15437

    h20delirious

    ok sir finally got it to work thanks a lot, now what I want to do is that I want to load a custom map that I have created in mapbox editor (it is a very small map that includes markers,lines,polygons (features that were specified in mapbox editor)), i tried changing the map_id and access token of my map in the source code of the examples giben in the maps subcategory of app examples provided in the v-play sample launcher but all was in vain.

    So sir could you please tell how can I upload a custom map created in mapbox editor in any one of those examples if not then how can i create a custom map as simple as that in mapbox editor and still be able to use it in the examples provided.

    Thanks in advance

Viewing 4 posts - 16 through 19 (of 19 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support