No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Cordova Google Maps Plugin

    Help
    cordova cordova-plugin google api google maps quasar-cli
    1
    1
    406
    Loading More Posts
    • 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.
    • K
      kw_7 last edited by kw_7

      I have been trying to use a cordova google map plugin from https://github.com/mapsplugin/cordova-plugin-googlemaps and am yet to get it to run smoothly on my android.

      I found the code

      <template>
      <q-page class="q-pa-xl">
          <h1>Hello, World!</h1>
          <div id="map_canvas">
            <button id="button">Click me!</button>
          </div>
      
      </q-page>
      </template>
      
      <script>
      export default {
        name: 'Map',
        created () {
          // Vuex get the map lat/lng
          document.addEventListener('deviceready', () => {
          var div = document.getElementById('map_canvas')
      
          // Create a Google Maps native view under the map_canvas div.
          //var map = plugin.google.maps.Map.getMap(div)
          var map = window.plugin.google.maps.Map.getMap(div)
      
          // If you click the button, do something...
          var button = document.getElementById('button')
          button.addEventListener('click', function () {
            // Move to the position with animation
            map.animateCamera({
              target: {lat: 37.422359, lng: -122.084344},
              zoom: 17,
              tilt: 60,
              bearing: 140,
              duration: 5000
            })
      
            // Add a maker
            var marker = map.addMarker({
              position: {lat: 37.422359, lng: -122.084344},
              title: 'Welecome to \n' +
                      'Cordova GoogleMaps plugin for iOS and Android',
              snippet: 'This plugin is awesome!',
              animation: window.plugin.google.maps.Animation.BOUNCE
            })
      
            // Show the info window
            marker.showInfoWindow()
          })
          }, false)
        }
      }
      </script>
      
      

      and have added
      <preference name="GOOGLE_MAPS_ANDROID_API_KEY" value="my api key" />
      to config.xml in src-cordova but it will not display on my app.

      have not tried on ios.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post