I have a large amount of data (thousands of polygons) that I want to share with people through my site. I want them to be able to view the polygons, and due to the large amount of data, I am not worried about them stealing this data through the displayed google map. However, since the kml file must be accessible to google, a proficient coder could discover the url of the kml files and simply download the entire file. Is there any way to restrict access to these kml files only to google so no outside people can get to them. I have tried .htaccess, but I can't figure out how to restrict access to everyone but google. Any ideas?
not a great solution but you could monitor the IP addresses used by Google calling back to your KML and then setup a frontend proxy to only allow those addresses access. Obviously, this list would need to be dynamic and constantly tended to but over time, you might find the block of IPs Google uses for KML Layer callbacks is fairly stable. It would also be great list to post back to this group :)
YMMV, cheers brian
i check the $_SERVER["HTTP_USER_AGENT"] variable for google.
and if is correct i generate the kml from php.
$agent = "Kml-Google"; $google = strpos($_SERVER["HTTP_USER_AGENT"], $agent); ($google !== FALSE) or die; header('Content-Type: application/vnd.google-earth.kml+xml kml'); header('Content-Disposition: attachment; filename="otras.kml"'); ?> <?xml version="1.0" encoding="UTF-8"?> <kml xml ...