Harel R
Harel R

Reputation: 41

obfuscation of google maps javascript code

I'm building a php-javascript-google maps website. The php part is for querying the MySQL database and echoing the result into Javascript. The google maps is presented by a Javascript code which is client side. As it is a client side code the user can easily see the code and just copy my locations and additional presented data which is actually the business itself. This issue really worries me. I read about obfuscation software https://en.wikipedia.org/wiki/Obfuscation_(software)

Is someone familiar with such a solution on java script google maps? I also read about loading the data after the page loads using a delayed onclick() method but this isn't a good solution for my site.

This is the method I use in order to load data and present it.

$query = "SELECT * FROM .... = '$x'";
$result = mysql_query($query) or die ("Invalid query" . mysql_error());

while ($row = mysql_fetch_array($result))
{

    echo "\n var myLatLng = {lat: ".$row['Latitude'].", lng:".$row['Longitude']."};";

}

Upvotes: 0

Views: 201

Answers (1)

user5115411
user5115411

Reputation:

Security through obscurity will not help to protect your business information. There are many javascript deobfuscators, which can be used to process your obfuscated javascript.

Moreover, if a user cannot access javascript, he can copy location coordinates using Google Maps interface. Is it ok for you? If so, someone who has enough patience may collect all the information you want to protect.

Looks that there's a something unclear with your business idea. Please provide more information on your task.

p.s it should be a comment, I know. But I cannot post comments until I have 50 rep.

Upvotes: 1

Related Questions