|
| 1 | +<p align="center"><img src="docs/images/logo.png" alt="Logo of the project"> |
| 2 | +<h1 align="center">MapSwitcher</h1> |
| 3 | +<br> |
| 4 | +<p align="center">A browser extension to switch between map websites.</p> |
| 5 | +<br> |
| 6 | +<p align="center"><img src="docs/images/screenshots/main.gif" alt="Screenshot of the extension"></p> |
| 7 | + |
| 8 | + |
| 9 | +About |
| 10 | +----- |
| 11 | +*MapSwitcher* is a small browser extension which adds buttons to various map services for opening the displayed location in a different service. |
| 12 | + |
| 13 | +Currently supported is switching between Google Maps, Mapy.cz and Geoportal.gov.cz. |
| 14 | + |
| 15 | +This is a small summer project which I did to get some practice with developing browser extensions. There are a few similar projects available, but none support Geoportal.gov.cz and I didn't like their user experience, so I wanted to make a free, simple, open source alternative which would suit my needs and would integrate well with the supported services. |
| 16 | + |
| 17 | + |
| 18 | +Installation |
| 19 | +------------ |
| 20 | +*MapSwitcher* currently supports Google Chrome, Mozilla Firefox and Opera. |
| 21 | + |
| 22 | +To install, download the extension either from the [Chrome Web Store](https://chrome.google.com/webstore/detail/mapswitcher/eogccmggebhlkjdjhlgddmnkffjfjamo) or the [Firefox Add-Ons](https://addons.mozilla.org/en-US/firefox/addon/map-switcher/) portal. |
| 23 | + |
| 24 | + |
| 25 | +Usage |
| 26 | +----- |
| 27 | +*MapSwitcher* adds buttons to the tools sections of Google Maps and Mapy.cz, clicking on which opens the currently displayed location in Google Maps, Mapy.cz or Geoportal.gov.cz. |
| 28 | +In the extension options you can decide which buttons will be shown, as well as whether the new map will open in a new tab. |
| 29 | + |
| 30 | + |
| 31 | +Developing |
| 32 | +---------- |
| 33 | +*MapSwitcher* is a fairly standard WebExtension, prepared to work in all the major browsers supporting WebExtensions. |
| 34 | +Currently it is tested to work in Google Chrome, Mozilla Firefox and Opera, with support for Microsoft Edge coming as soon as Edge officially switches to a Chromium base in the stable releases. |
| 35 | + |
| 36 | +The extension injects content scripts to the supported services, which on load of the page insert the desired buttons to the DOM. |
| 37 | +When clicking those buttons, the currently displayed location gets extracted from the page URL and gets converted to the coordinate system used by the target service, |
| 38 | +from which the target URL is assembled and then opened. |
| 39 | + |
| 40 | +### Quirks and perks |
| 41 | +Most of the work the extension does happens in content scripts, except for the retrieval of Geoportal.gov.cz URLs. |
| 42 | +Geoportal uses a private API to request permalinks to a map view of a given location, and the API does not accept cross-origin requests. |
| 43 | +To work around that, we need to send requests to the API from a background script, which avoids the CORS problems. |
| 44 | + |
| 45 | + |
| 46 | +Links |
| 47 | +----- |
| 48 | +- [Project homepage](https://www.nesveda.com/projects/MapSwitcher/) |
| 49 | +- [Project repository](https://www.github.com/fnesveda/MapSwitcher/) |
| 50 | + |
| 51 | +Licensing |
| 52 | +--------- |
| 53 | +The code in this project is licensed under the MIT license. |
| 54 | +Everybody is welcome to use, change and modify the project as they see fit. |
| 55 | + |
| 56 | +The Google Maps, Mapy.cz and Geoportal.gov.cz logos are registered trademarks of their respective owners, and are used within this project only for identification purposes. |
0 commit comments