Are you looking for something like this:
Uses geoxml3 to render a KML file. Detects the country polygons that are visible in the viewport and displays them in the sidebar.
题
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.
解决方案
Are you looking for something like this:
Uses geoxml3 to render a KML file. Detects the country polygons that are visible in the viewport and displays them in the sidebar.