For Kilopedia I wanted to visualize all the places in Google Earth. The best way is to use KML on-line abilities.
For the application itself it's as easy as a simple XML file:
Server-side is a bit more complex, but it's still nothing difficult to do. Google Earth will send a “BBOX” GET attribute with bounding box coordinates (coordinates for top-left and bottom-right corners).
So you only need to extract those, query them in your latitude/longitude database and return appropriate XML:
As a cherry on top I added an overlay, so anybody knows what the source of all the placemarks is.
Ok, I noticed quite a few projects are on GitHub, so I got one repo also. I’m not committing there anything any time soon, but better to be prepared and start to learn what I need to know.
One struggle was to choose the license. I pushed my selfish me further away and chose the shortest one – MIT License (aka X11 License), which is the most permissive.
Then I understood I will need some “header” in my source code files, so I constructed two simple lines of code, one is copyright and license info, second is version (YY.MM.DD) and short description of the source file:
I’m going to comment scripts quite well (as I did in recent past), but I also think the code should be self-explanatory, so I’ll try to stay modest.
Currently I feel this step as yet another way how to send a word about QetriX, but maybe it will catch on and somebody will rub the code into my face, which will ultimately make me a better programmer :)
On the other hand I’m little worried people may have problems with my way of coding. My programming is mostly “just enough”. I don’t build vast object schemas and in PHP I still prefer the old function way, because it’s faster and less greedy for resources. I’m aware, that bloated code is mostly bug fixes, but IMO less code means less things that could go wrong.
Then, I don’t comply to wide used coding standards, because on QetriX I’m trying to unify coding across various platforms, so I did quite a research on coding standards for particular languages, chose the most used parts and stuck with it. This includes using double quotes in PHP and JS for strings, because in other languages single quotes are for char datatype, while double quotes are for strings.