Google earth with Map in api v3 - google-maps

Can we get Google earth as a Map Type Id in api v3 ..
As this is done in Google maps also..
Check it out here
Can we do it ?

Here is the Google ticket requesting to add the "Earth" button to the map type control.
And a more recent (started last summer) issue specifically asking for MapsGL support. (The more stars this issues gets, clicking the start to the left of the issue title...the faster it gets resolved! So add your vote!)
See this question: Google Earth integrated with Google Maps API v3?

If you want to get the MapTypeId you can do it like:
var mapTypeId = myMap.getMapTypeId();
You can set MapType like:
myMapObject.setMapTypeId(google.maps.MapTypeId.SATELLITE);

Related

Google Map UI Experience not available in api (borde, style)?

Google Search gives a perfect UI Experience, while I cannot able to bring the same in google api. please advise how to proceed.
I am using kml layer for borderline to country and states, but data is not perfect as google
I tried google embed map, But I don't know how to write the click event on the map, because the map is bind on I-frame.
i attached the image below from google maps
enter image description here
There is already a feature request for this in the IssueTracker for Google Maps Platform. You can star this issue to get updates on it.
https://issuetracker.google.com/35816953

Set camera in Google Maps 3D view using JavaScript

I have recorded flight track data (lat, lon, altitude, angle, speed...) and want to simulate a cockpit view of the recorded flight.
Is there a JavaScript API to do this in 3D Google Maps (set and move camera view in Google Maps 3D)?
I am new to Google Maps API and cannot find documentation for this.
I think you can't do it using Javascript API. But closest thing for this is by using Styled Maps. As of now only Google Maps Android API and Google Maps SDK for iOS
can do it.
I found the very cool framework cesiumjs
which provides excatly what i was searching for.
Set camera with heading, roll, pitch and altitude.

How to load new google maps with API v3

Classic My Maps on maps.google.com will no longer be available.
Now we must use new maps. I would like to embed them to the website, without iframe that google suggests.
Before this change I used simple kml layer:
var kmlLayer = new google.maps.KmlLayer('https://maps.google.com/maps/ms?ie=UTF8&t=m&authuser=0&msa=0&output=kml&msid=212840568890456843825.0004c1fba0c8371a81c2b');";
kmlLayer.setMap(gMap);
But during the automatic update of my maps it was broken, if I use the same link - I got empty icons. Here is the new map (converted by google), can I load it using API V3 as I did before?
https://www.google.com/maps/d/viewer?mid=zhJ_pzBRPGN8.kCI6hT4Kq0Ao
In other words:
I want to create maps here: https://www.google.com/maps/d/
And to embed them using API v3, but where can I get a link to the layer? Central coordinate, zoom level?
Change the KML Layer link to:
https://mapsengine.google.com/map/kml?mid=zhJ_pzBRPGN8.kCI6hT4Kq0Ao&lid=zhJ_pzBRPGN8.kZ0hfyeW-GtI
I grabbed this link from the "Share", "Download KML" URL on the Map that you linked to.

Bing map conflicts when used with Google map API

I am using google map in my application. I have an application regarding to property sales and purchase for that I have used google map.
But now I have to add Bird's Eye view in it. Since there is no such a concept in google map api, I have decided to use Bing map.
But when I implemented a bing map in it, It affected the functionality of google map.
Means it conflicted the google map.
Can't I use bing map with google map?
Have any Idea?
When you want to use both Google map and Bing map in your application, then you can use different iframe for each.
It will prevent conflicting between each other...
Thanks to brian.behling for their post on Google help forum.
Here is the link for that :
http://www.google.com/support/forum/p/maps/thread?tid=0d28300c9c0f585e&hl=en&fid=0d28300c9c0f585e00048bf69617bd9e
I have answered this question just because anyone else can refer to that easily...
Regards.

How do I link to Google Maps with a particular longitude and latitude?

I have a small application that gives the current location: longitude and latitude.
Now I have to browse to google maps with the longitude and latitude.
Please suggest how I can do this.
The best way is to use q parameter so that it displays the map with the point marked. eg.:
https://maps.google.com/?q=<lat>,<lng>
This schema has changed again (23rd October 2018). See Kushagr's answer for the latest.
This for a map with the marker (via aaronm's comment):
https://www.google.com/maps/?q=-15.623037,18.388672
For an older example (no marker on this one):
https://www.google.com/maps/preview/#-15.623037,18.388672,8z
The oldest format:
http://maps.google.com/maps?ll=-15.623037,18.388672&spn=65.61535,79.013672
As of today (1st November, 2020), Google provided a provision of Universal URL which works quite efficiently on cross-platforms and thus, Google recommends this method.
Syntax: https://www.google.com/maps/search/?api=1&query=<lat>,<lng>
Example :
https://www.google.com/maps/search/?api=1&query=28.6139,77.2090
(New Delhi, India)
Documentation/Source.
As of today (2014/09/23), I've found that to get marker on exact place (not an approximation) you can use:
http://www.google.com/maps/place/49.46800006494457,17.11514008755796
Additionally, if you want to specify map center and zoom:
http://www.google.com/maps/place/49.46800006494457,17.11514008755796/#49.46800006494457,17.11514008755796,17z
If you want to use satellite map type, then append /data=!3m1!1e3
http://www.google.com/maps/place/49.46800006494457,17.11514008755796/#49.46800006494457,17.11514008755796,17z/data=!3m1!1e3
And If you want terrain view of the map, then append /data=!3m1!4b1
https://www.google.com/maps/place/49.46800006494457,17.11514008755796/#49.46800006494457,17.11514008755796,17z/data=!3m1!4b1
If you want to open Google Maps in a browser:
http://maps.google.com/?q=<lat>,<lng>
To open the Google Maps app on an iOS mobile device, use the Google Maps URL Scheme:
comgooglemaps://?q=<lat>,<lng>
To open the Google Maps app on Android, use the geo: intent:
geo:<lat>,<lng>?z=<zoom>
It´s out of the scope of the question, but I think it might be also interesting to know how to link to a route. The query would look like this:
https://www.google.es/maps/dir/'52.51758801683297,13.397978515625027'/'52.49083837044266,13.369826049804715'
These are URLs that work:
http://maps.google.com/?q=<LAT>,<LNG>
https://maps.google.com/?q=<LAT>,<LNG>&ll=<LAT>,<LNG>&z=18
https://www.google.com/maps/#<LAT>,<LNG>,16z
https://maps.google.com/?q=<LAT>,<LNG>&z=16
Although (for avid readers) This is the latest from google (August 22 2017):
Maps URLs
Maps URLs with map display
Maps URLs with search action
From google
Search: When searching for a specific place, the resulting map puts a pin in the specified location and displays available place details.
Important: The parameter api=1 identifies the version of Maps URLs this URL is intended for. This parameter is required in every request. The only valid value is 1. If api=1 is NOT present in the URL, all parameters are ignored and the default Google Maps app will launch, either in a browser or the Google Maps mobile app, depending on the platform in use (for example, https://www.google.com/maps).
This works too:
https://www.google.pl/maps/#<lat>,<lon>,<zoom>z
Example.
With pointer:
https://www.google.com/maps/place/<lat>,<lon>/#<lat>,<lon>,<zoom>z
Example.
To open the google maps app in android:-
geo:<lat>,<lng>?z=<zoom>
open app with marker for give location:-
geo:<lat>,<lng>?q=<lat>,<lng>(Label,Name)
open google map in ios:-
comgooglemaps://?q=<lat>,<lng>
open google maps in browser with following parameters:-
http://maps.google.com/maps?z=12&t=m&q=<lat>,<lng>
z is the zoom level (1-21)
t is the map type ("m" map, "k" satellite, "h" hybrid, "p" terrain, "e" GoogleEarth)
q is the search query
Using the query parameter won't work, Google will try to approximate the location.
The location I want : http://maps.google.com/maps?ll=43.7920533400153,6.37761393942265
The approximate location (west of the actual location) : http://maps.google.com/?q=43.7920533400153,6.37761393942265
say easily http://www.google.com/maps/place/lat,lng format
sample url:
http://www.google.com/maps/place/30.364124,48.227034
To get your current location as start point you need to use this URL:
https://www.google.com/maps/dir/?api=1&origin=Current+Location&destination=<latitude>,<longitude>
You can fill up the destination parameter with the address, name or latitude and longitude values.
Open the following url with the latitude and longitude and zoom level.
https://maps.google.com/?q=23.22,88.32&z=8
Find your location in the Google Earth program, and click the icon "View in Google Maps". The URL bar in your browser will show the URL you need.
Open google map and show URL schemes location and location pin
UIApplication.shared.openURL(URL(string:"https://maps.google.com/?q=\(dicLocation.stringValueForKey("latitude")),\(dicLocation.stringValueForKey("longitude")),15z")!)
if you want a dir with travel mode = walking
https://www.google.es/maps/dir/'52.51758801683297,13.397978515625027'/'52.49083837044266,13.369826049804715'/data=!4m2!4m1!3e2