Google Map Over Lays using KML file - google-maps

I have a KML file with hundreds of lat/long points used to draw overlays on Google Maps.
Example KML file. http://www.no5w.com/OverlayON_Rev2.kml
Example displayed on a map:
http://www.no5w.com/CQxONOverlay.html
My problem is placing markers on the map. I only want to display markers on the map if they are within the overlay.
Is there any way to do this?
Thanks in advance.

Related

How to create Google Static Map with polyline data

How can we create a google static map with a custom polyline overlay?
I need to create a map image, which has to be embedded into a pdf report. The basemap will be google, and on top of that, we need to show the markers and polylines.
I could see some docs to include marker while creating google static maps. but couldn't figure out a solution for including custom polyline on that. I've the polyline data in my database as geojson and can change it to any other defined format if required, from a nodejs api.
Could anyone suggest a solution for this?
Thanks in advance

KML <IconStyle> Tag is not working in google map

I have a KMl file with some multigeometries. When I import this KML file in Google Earth it looks like this image.
But when I Import same KML in Google Map is shows Like This
In Place of Lable it shows default blue color icon.
this is My Sample KMl for One Multigeomety
<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2"><Document><Style id="Yellow"><IconStyle><scale>0</scale></IconStyle><PolyStyle><color>6414F0FF</color></PolyStyle></Style><Placemark><styleUrl>#Yellow</styleUrl><name>0,15</name><MultiGeometry><Point><coordinates>-97.04983000000001,32.81053</coordinates></Point><Polygon><outerBoundaryIs><LinearRing><coordinates>-97.05083000000002,32.81083 -97.04667,32.81083 -97.04667,32.8075 -97.05083000000002,32.8075 -97.05083000000002,32.81083</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry></Placemark></Document></kml>
I have already googled so many time, Please help on this.
Google Maps has issues with MultiGeometry placemarks.
If want label from the point and use Polygon then best to have separate placemark for Point with LabelStyle/IconStyle and another for the Polygon. Google Earth has no such issue with MultiGeometry features.
UPDATE:
Using Google Maps KmlLayer does not allow the label names to appear on the map - label only appears when click on placemark icon. If you want to stay with Google Maps then you might try geoxml3 library to parse the KML then enumerate the placemark and create Markers using Google Maps API. Alternately, can use Openlayers or Cesium to parse KML and display correctly.

Loading kml markers above polygon

I am working with a google map api 3, on my map i want to generate kml markers after polygons, but it is not working, my markers are generate before polygons so i am not able to click marker.
Native Google Maps Javascript API v3 polygons will always appear on top of KML layers. If you want to control the order, use a KmlLayer to display the polygon as well, add that layer first or control the order with the zIndex property of the KmlLayers.
related question: https://stackoverflow.com/questions/35455830/kml-ordering-in-google-maps-api (including example)

KML overlays with tiled images in incorrect positions

I have made a map with a series of overlays of old maps that I created using MapTiler and the coordinates were definitely correct when I plotted them in Google Earth, but when I load the KML files in Google Maps they are roughly in the correct area but are far from accurate.
As the same error is replicated in all the layers can someone suggest what it is that I am doing wrong?
http://www.southdevonaonb.org.uk/cordialemapping/kmzdata/withtiledoverlays/19x/doc.kml
http://www.southdevonaonb.org.uk/cordialemapping/kmzdata/withtiledoverlays/20x/doc.kml
The other KML files can be found by changing the URL to 21x, 22, 23x, 25x, 26x, 27x (I am unable to post more than two links).

Can I manipulate a KML using Google Maps API v3?

I'm loading a KML using KMLLayer in Google Maps API v3. Is it possible to reference the polygons on the map and do things like change color or transparency?
No you can't do it like that since there are no polygons like objects in a kmllayer. From the google docs:
The Maps API converts the provided geographic XML data into a KML
representation which is displayed on the map using a V3 tile overlay.
This KML looks (and somewhat behaves) like familiar V3 overlay
elements. KML and GeoRSS point elements are rendered as
markers, for example, elements are rendered as polylines
and elements are rendered as polygons. Similarly,
elements are rendered as rectangular images on the
map. Importantly, however, these objects are not Google Maps API
Markers, Polylines, Polygons or GroundOverlays; instead, they are
rendered into a single object on the map.
This page might be helpfull in exploring alternatives