Drawing holes in KML polygons in Google Maps or on Earth does not work. Does anyone have an idea?

This is my kml file:

<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Placemark> <name>Pentagon</name> <Polygon> <extrude>1</extrude> <altitudeMode>relativeToGround</altitudeMode> <outerBoundaryIs> <LinearRing> <coordinates> -77.05788457660967,38.87253259892824,100 -77.05465973756702,38.87291016281703,100 -77.05315536854791,38.87053267794386,100 -77.05552622493516,38.868757801256,100 -77.05844056290393,38.86996206506943,100 -77.05788457660967,38.87253259892824,100 </coordinates> </LinearRing> </outerBoundaryIs> <innerBoundaryIs> <LinearRing> <coordinates> -77.05668055019126,38.87154239798456,100 -77.05542625960818,38.87167890344077,100 -77.05485125901024,38.87076535397792,100 -77.05577677433152,38.87008686581446,100 -77.05691162017543,38.87054446963351,100 -77.05668055019126,38.87154239798456,100 </coordinates> </LinearRing> </innerBoundaryIs> </Polygon> </Placemark> </kml> 

I import it on Google Maps (my maps) or Google Earth, and the "hole" is not displayed. Code taken from KML Tutorial - Advanced KML Documents

+4
source share
2 answers

It’s strange. I definitely see the extruded polygon in Google Earth, but it seems that Google Maps is incorrectly drawing the intersection of the outerBoundaryIs and innerBoundaryIs (although I see the inner border, but not necessarily the polygon with a completely hollow center). I think in this case it seems that the overlays of Google Maps do not fully comply with the KML specification.

0
source

I see an extruded pentagon with a beautiful hole in the middle ... but only on Google Earth. On google maps (normal, without using it through geoxml3) a hole does not appear. Probably, as Wyatt Anderson said, Google Maps is not fully compatible with this KML feature ... But if you use geoxml3, you will get it. I had the same problem and solved it with geoxml3.js. Good luck

0
source

Source: https://habr.com/ru/post/1340816/


All Articles