tags:

views:

31

answers:

2

Hi,

I am trying to switch from virtual (VE) earth to google map (GM).

It is pretty easy to overlay a georss feed over a map in VE as well as in GM:

var georssLayer = new google.maps.KmlLayer('www.bla.com/kmls/k1');
georssLayer.setMap(map);

Unfortunately, google requires the 'kml address' to be public. What can I do to achieve the same functionality if my address is not public (e.g. when the user has to login before [s]he can enjoy the map)?

Thanks.

Christian

A: 

Answered here:

http://stackoverflow.com/questions/3435566/google-maps-kml-files

Marcelo
thanks. I was aware of this but it does not really answer my question.
csetzkorn
+1  A: 

I've thought about this issue before and this is the solution I've come up with (although I haven't implemented it yet).

  • The server code that generates the html page in which the map is embedded should generate a temporary token that is tied to the current user in the database.
  • Make the KML address public, but pass the temporary token to it as a query parameter
  • Include logic in the KML server code that checks the passed token to be sure it is valid
  • The token should only be valid for a limited time.

This solution will be slightly less secure than full id/pw authentication on the KML resource. But by using a short lived token, it may be good enough, depending on your requirements.

Mark
Interesting solution. Should not be a problem.
csetzkorn