How to load new google maps with API v3 - google-maps

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.

Related

How to add a custom path to google maps and use it with directions api?

I want to use the google maps javascript API for my project. I am using directions API to show path between two places on the map. My problem is since this app is focusing on a very rural area all the paths in the area still not in the google maps. Can I include those new paths to my instance of google maps and use the directions API to navigate through the paths? How can I do this? Is there a way to add a path to map as a polyline and use it for directions?
Update:
here is a screenshot of the application I was developing.
The white color path, works with directions api. I draw a polygon with coordinates I know of the unknown path, I want to use that path with directions api to show directions.

How to create link to google map with opened info and window

I need to create link on google maps with marker + infowindow
I found this link:
url http://www.google.com/maps?q=41.0082,28.9784(INFO_WINDOW)
used to work before. But now it doesn't work anymore.
That is the "old"/"classic" Google Maps, it no longer works.
Some options:
Look at the embed API
Create a Google Maps Javascript API v3 map of your own that supports that functionality (example)

Google Maps - Link from static image with markers to full maps.google.com

I need to redirect from a static google maps image via the Static Maps API to maps.google.com.
I have multiple markers on the map. Example: "http://maps.googleapis.com/maps/api/staticmap?size=235x227&maptype=roadmap&markers=37.970982,23.724559|37.971487,23.724953|37.973291,23.726862"
I need the proper url format that, when the image is clicked, will redirect to maps.google.com with all markers placed on the map. I cant find the documentation on how to do this.
There are no way to add markers into the google maps now.. so the answer is no.
However, you can build a custom page, which uses the google maps API and you can add markers that way.
I built a sample page here in github.
so for your map:
you can wrap it with an a element which link to your page with the same option like this sample:
http://kylelam.github.io/SO/customMarkers.html?size=235x227&maptype=roadmap&markers=37.970982,23.724559|37.971487,23.724953|37.973291,23.726862

draw a pin in glass google maps

I'm using glass development kit, and I'm trying to show a pin.
Is there a google map sample ready to use ?to add my pin.
I saw I can use MapView if it was for an android app but with GDK it doesn't seems to work.
The position of the pin will be auto determinated by the network.
Static Maps is the thing you're looking for.
It allows you to embed a Google Maps image on your application.
You can easily download the content and apply it to an ImageView.
Google recently published a new Google Maps Lite wich can be directly used as a fragment. (sample code included)
Both method will allow you to drop pins on the map, without using the original MapView.

Open placemark id with an a href from KML layer (Google Maps Api v3)

I have created a google maps dealer locator. All (55) dealers are saved into a KML file which i load into my google maps:
See: http://paste2.org/p/2248187
I have a search function that finds the closest dealers from your location. The results get printed in a list. Note that this list is outside the Google Maps, in a html sidebar. When I click on the nearest dealer I would like to open the infowindow of that dealer/placemark by using it's ID.
So in short, click on a button outside the google map and an infowindow should open inside the google map.
I have googled for this a lot, but couldn't find anything about opening KML placemark infowindows.
it should be as simple like:
http://paste2.org/p/2248193
Any ideas?
That functionality is not available with KmlLayer (at least not now).
Either use a third party KML parser like geoxml3 or geoxml-v3 or import your KML into FusionTables and use that.
Example using geoxml3
Example using Fusion Tables