PDA

View Full Version : How does a service like Google Maps operate without exposing it's javascript code?



PepperBoy123
Apr 30th, 2016, 03:53 PM
Hello,
I understand that in a service like Google maps, data about surrounding areas, building, roads etc comes from a (say php/node.js) server. However, my question is regarding the visualization framework which displays maps.

Is the code for the visualization written in javascript? For example, the three.js visualization library, written in JS, and whose code is visible on viewing Page source.

Or is this done using a server side language as well, which then generates HTML ? If yes, how is the HTML to display maps generated, since that would be more complex than what is supported by HTML5?

VIPStephan
Apr 30th, 2016, 07:28 PM
I haven’t analyzed it thoroughly but I can assure you that even Google can’t hide their front-end code from you. Whatever is displayed in your browser you could theoretically view and analyze. They likely compress and therefore obstruct their code very much so that it becomes inconceivable for humans but they can’t hide it.

PepperBoy123
Apr 30th, 2016, 08:52 PM
I havenít analyzed it thoroughly but I can assure you that even Google canít hide their front-end code from you. Whatever is displayed in your browser you could theoretically view and analyze. They likely compress and therefore obstruct their code very much so that it becomes inconceivable for humans but they canít hide it.
Thanks for the reply.
Just came to my mind, since I'm working on this purely front-end (HTML/CSS/JS) project at school, and at this point in time, I'm not sure if I want to make the code so public (View page source).

So does that mean that ALL front end projects are open source irrespective of the number of people who have worked on it, and the resources that've gone into it. Confused :)

Is there a way to hide JS code? (I came across minification, but was also able to generate it's unminified code using tools online )

VIPStephan
Apr 30th, 2016, 09:56 PM
Is there a way to hide JS code?

Yes: Never put it online. Otherwise, no, not on a public website.

PepperBoy123
May 1st, 2016, 09:48 AM
Yes: Never put it online. Otherwise, no, not on a public website.
:) Thanks VIPStephan, get the point.