SSP
SSP

Reputation: 2670

Google maps V3 implementation in android app

How do I get access to the Google Indoor Maps on my Android app? I am using below tutorial :-

https://developers.google.com/maps/documentation/javascript/tutorial

By the help of above tutorial i made below page

<!DOCTYPE html>
<html>
  <head>
    <title>Asynchronous Loading</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
    </style>
    <script>
function initialize() {
  var mapOptions = {
    zoom: 8,
    center: new google.maps.LatLng(-34.397, 150.644)
  };

  var map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions);
}

function loadScript() {
  var script = document.createElement('script');
  script.type = 'text/javascript';
  script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp' +
      '&signed_in=true&callback=initialize';
  document.body.appendChild(script);
}

window.onload = loadScript;

    </script>
    </head>
  <body>
    <div id="map-canvas"></div>
  </body>
</html>

now i have a list of indoor maps available location (https://support.google.com/gmm/answer/1685827?hl=en).

when i search for 1 location and zoom it i don't get option to select different floor but when i use normal google maps application or web maps i get option to choose floor.

For testing we can run this html page directly on browser.

I can access the indoor maps for Switzerland (Sihlcity, Zurich Airport) using the official Google Maps app on Android so ideally it should work in my personal Android app as well.

Does it work using the same Google Maps APIs or is there a separate logic for indoor maps?

Many thanks in advance for your reply.

Upvotes: 3

Views: 977

Answers (1)

kaho
kaho

Reputation: 4784

You can not do it with the web Google Maps API v3. It simply does not have that function yet.

However, if you are building a native Android and using the Google Maps Android API v2, the default behavior is to show the floor plan and the indoor level picker.

For more information about the indoor maps in Google Maps Android API v2: https://developers.google.com/maps/documentation/android/map?hl=it#indoor_maps

Upvotes: 1

Related Questions