Highlighting for two countries (Google Maps API)

Viewed 28

I have to make add highlight for two countries: Poland and Germany. I found something like that:

https://developers.google.com/maps/documentation/javascript/dds-boundaries/coverage

BUT I need something reverse:

  1. All of countries has to been covered by some overlay (on example: white background with some opacity)
  2. Only two countries (Poland and germany) has to be highlighted without these overlays

Sample:

enter image description here

I don't have idea how can I do it.

1 Answers

Related questions:

One option:

  1. go to http://www.gadm.org/download, download the adm0 file for Germany and the adm0 file for Poland

  2. Combine those polygons (as the inner ring(s)) with a polygon that covers the whole earth (see KML invert country border )

  3. zip up the resulting kml, rename to kmz. Display on the map using geoxml3

example with Germany and Poland

screenshot of resulting map

Note that this won't work (at present) with the Google Maps JavaScript API v3 native KmlLayer renderer.

Related