Languages

Menu
Sites
Language
Open Google Maps from Webapp

Hey there,

I'm trying to open google maps from wearable web application on my connected phone (iPhone SE).
Is this even possible?

I found

tizen.application.launch()

but the launch command needs an app ID and I don't know the one for google maps.
Is it "com.google.Maps"? Is it "585027354" (from itunes.apple.com/de/app/google-maps-transit-essen/id585027354?mt=8 )?

If it's possible, can I provide some parameters to the launch? E.g. tell google maps to guide me to a given position (lang+lat)?

Thanks in advance guys.

Best regards
Nick

Edited by: Nick Böcker on 06 Mar, 2019

Responses

4 Replies
Martin LINES

I used the Google Java APIs to launch google maps with a Lat/Long and label information.

 

 

 

  <script>
      		var map;
  			var marker;
      				console.log(window.myBoatLat);
      				console.log(window.myBoatLong);
      				// Initialise the map
      				function initMap() {
        				map = new google.maps.Map(document.getElementById('map'), {
          				center: {lat: window.myBoatLat, lng: window.myBoatLong},
          				zoom: 12
        				});
        			// Create the text box information
        			        var contentString = '<div id="content">'+
           						 '<div id="siteNotice">'+
					            '</div>'+
            '<h1 id="firstHeading" class="firstHeading">Witch Way</h1>'+
            '<div id="bodyContent" class=content_subtext">'+
            '<h2><b>Time: </b>'+window.myBoatDeviceTime+'<br>'+
            '<b>Speed: </b>'+window.myBoatSpeed+' Knots<br>'+
            '<b>Heading: </b>'+window.myBoatCourse+'°</h2>'+
            '</div>'+
            '</div>';

        var infowindow = new google.maps.InfoWindow({
          content: contentString
        });
        			
      				//Set up the marker
      				var marker = new google.maps.Marker({
					    position: {lat: window.myBoatLat, lng: window.myBoatLong},
					    map: map,
					    icon: 'http://www.sportsboat.org.uk/images/junkpictures/speedboat.png',
 						title: 'Witch Way'
 					});
 			     	marker.addListener('click', function() {
          				infowindow.open(map, marker);
        			});
        			
      				}


  </script>
  <script src="http://maps.googleapis.com/maps/api/js?key=YourMapKeyHere4&callback=initMap"></script>
  </body>

You wil need to subscribe to a Google Map Key ID, but its basically free for personal use based on a low volume of calls

silver

Do you mind sharing the whole code with me ?

Nick Böcker

Hey Martin, 

thanks for your answer. Guess I wasn't so clear about my thoughts:
I want to open google maps on the connected device not on the wearable itself.

So when I touch on a button on the wearable e.g. "Navigate" my phone should wake up and open google maps with the parameters I provided.
Guess the way you did it is my second attempt. But navigation on the connected phone would be much more comfortable.

Thanks anyway!

Greetings
Nick

Martin LINES

Nick

Ah, sorry, yes I did misunderstand.

 

Martin