Question

Following part of code delivers me the country where my marker (not draggable) is set …

for (var i = 0; i < results[0].address_components.length; i++) {
  if (results[0].address_components[i].types[0] == "country") {
     clientPositionMarkerCountry = results[0].address_components[i].long_name;
  }
}

When the user moves over an other country (e.g. next to this country or any other) I want to get the current country (or maybe if possible current countries) of the viewarea he is then.

Was it helpful?

Solution

Are you looking for something like this:

http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?lat=43.797409&lng=27.904508&zoom=6&type=m&filename=http://www.geocodezip.com/geoxml3_test/world_countries_kml.xml

Uses geoxml3 to render a KML file. Detects the country polygons that are visible in the viewport and displays them in the sidebar.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top