Introduction



Maps and Routing in Websites


Introduction


About myself


First of all, I would like to introduce myself: my name is Lukas Nussbaumer, I am from Italy, and this blog is going to be the work for my high school exam. Last summer I needed some of the things I will present later, and I found it quite interesting, so I decided to take maps and routing as topic for this final exam.



My topics - The 3 different solutions


Now on to what I am going to present: I will show ways to integrate different maps (mostly Google Maps and OpenStreetMap) into websites, and how to modify them using markers, pop-ups, and many other things. Also, I will explain how to make them able to route on their own, which is a very useful tool. My blog will be divided into 3 big parts: the first will be the “embed map” function Google provides on Google Maps. This one is the easiest to use; it takes almost no time, but it is not as customisable as the others are, for example, you cannot use markers, and the ways of interacting with that map are very few. Still, if you only need a map that shows one route from point A to point B, this is probably the best solution. It requires only very basic programming skills, no JavaScript is needed, and still gives a very good result. The second one is the Google Maps API. For this one you need basic skills in JavaScript, although most of the code can be understood from the documentation, which I will link in the sources. In this solution you can have markers, shapes, and many other things. You will have to get a Google Maps API key before you use it, but since most people have a gmail address anyway, and the key is for free, that should be no problem. In the third part I am going to talk about Leaflets, which uses OpenStreetMap as map, but provides the possibility of using markers, shapes, and also routing. This one is pretty similar to the Google Maps API, with the difference that it uses OpenStreetMap as map and not the Google Maps. The difference between these two maps will be the topic of another article.



Which solution is the best for you?


All these solutions are free, and OpenStreetMap is open source, so you can use the one that fits best for your requirements: if you need a simple map with maybe one fix route, the direct embed is probably the best solution for you. The other two are very similar, so you can choose the one of which you like the map most. If you need routing, you might want to go with Leaflets and OpenStreetMap, since the direct embed makes it only possible to display one fix route, and the Google Maps API makes it a bit harder to show routes, but that is just my personal opinion.

No comments:

Post a Comment