Skip to content

Commit 21fcadf

Browse files
committed
Initial commit
0 parents  commit 21fcadf

29 files changed

+874
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Changelog
2+
=========
3+
4+
[1.0.0](../../releases/tag/v1.0.0) - 2019-08-28
5+
-----------------------------------------------
6+
Initial release of the extension.

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2019 František Nesveda
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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&#46;cz and Geoportal&#46;gov&#46;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&#46;cz, clicking on which opens the currently displayed location in Google Maps, Mapy&#46;cz or Geoportal&#46;gov&#46;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&#46;gov&#46;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&#46;cz and Geoportal&#46;gov&#46;cz logos are registered trademarks of their respective owners, and are used within this project only for identification purposes.

docs/images/logo.png

2.55 KB
Loading

docs/images/screenshots/main.gif

1.12 MB
Loading

src/_locales/cs/messages.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extension_name": {"message": "MapSwitcher"},
3+
"extension_description": {"message": "Přidá do různých mapových služeb tlačítka pro otevření stejné pozice na mapě v jiných mapových službách."},
4+
"general_preferences_header": {"message": "Všeobecné možnosti"},
5+
"activate_new_tab": {"message": "Aktivovat nově otevřené záložky"},
6+
"visible_buttons_header": {"message": "Zobrazit tlačítka na přepínání do"},
7+
"google_maps": {"message": "Mapy Google"},
8+
"mapy_cz": {"message": "Mapy.cz"},
9+
"geoportal_gov_cz": {"message": "Geoportal.gov.cz"}
10+
}

src/_locales/en/messages.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extension_name": {"message": "MapSwitcher"},
3+
"extension_description": {"message" :"Adds buttons to various map services for opening the same location in different map services."},
4+
"general_preferences_header": {"message": "General preferences"},
5+
"activate_new_tab": {"message": "Activate newly opened tabs"},
6+
"visible_buttons_header": {"message": "Show buttons to switch to"},
7+
"google_maps": {"message": "Google Maps"},
8+
"mapy_cz": {"message": "Mapy.cz"},
9+
"geoportal_gov_cz": {"message": "Geoportal.gov.cz"}
10+
}

src/icons/icon-128.png

5.3 KB
Loading

src/icons/icon-16.png

668 Bytes
Loading

src/icons/icon-256.png

9.77 KB
Loading

0 commit comments

Comments
 (0)