On Jul 7, 3:04 pm, rohit <[email protected]> wrote:
> Hi,
>
> I have the exact geo-codes in my database. But I need to show a marker
> which is only a vicinity spot (say 2 miles away from the exact
> location). This is needed for location privacy. How can I best achieve
> this?

If you want the actual location to remain private, you cannot send it
to the browser, so any randomisation must be done server-side. This is
what I do in PHP:

  // Add the fudge factor to frustrate data-scraping of the geocoding
  // This moves the point up to 300m (0.004250deg) away. Should still
be ok
  // for map centre.
  $px=$px+((mt_rand(0,8500)-4250)/1000000);
  $py=$py+((mt_rand(0,8500)-4250)/1000000);

Just change the numbers for your desired distance and latitude (since
metres per degree depends on latitude). 300m is 0.004250deg at around
51deg latitude. Note that this moves the spot by *up to* 300m in any
direction. It could still place the location in exactly the right
place -- but that's very unlikely, and no-one will know if it is or
not.

Andrew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to