├── tmsforkorea
├── weblayers
│ ├── __init__.py
│ ├── icons
│ │ ├── kml.png
│ │ ├── daum_icon.png
│ │ ├── ngii_icon.png
│ │ ├── mango_icon.png
│ │ ├── naver_icon.png
│ │ ├── olleh_icon.png
│ │ └── vworld_icon.png
│ ├── html
│ │ ├── qgis.css
│ │ ├── daum_street.html
│ │ ├── naver_street_5179.html
│ │ ├── naver_hybrid_5179.html
│ │ ├── naver_physical_5179.html
│ │ ├── daum_cadastral.html
│ │ ├── daum_satellite.html
│ │ ├── naver_satellite_5179.html
│ │ ├── naver_cadastral_5179.html
│ │ ├── OpenLayers.Layer.DaumHybrid.js
│ │ ├── daum_hybrid.html
│ │ ├── mango_base.html
│ │ ├── mango_base_gray.html
│ │ ├── mango_hidpi.html
│ │ ├── mango_hidpi_gray.html
│ │ ├── daum_physical.html
│ │ ├── OlOverviewMarker.js
│ │ ├── OpenLayers.Layer.NaverStreet.js
│ │ ├── OpenLayers.Layer.NaverPhysical.js
│ │ ├── OpenLayers.Layer.NaverHybrid.js
│ │ ├── OpenLayers.Layer.NaverSatellite.js
│ │ ├── OpenLayers.Layer.NaverCadstral.js
│ │ ├── OpenLayers.Layer.DaumStreet.js
│ │ ├── OpenLayers.Layer.DaumCadstral.js
│ │ ├── OpenLayers.Layer.DaumPhysical.js
│ │ ├── OpenLayers.Layer.DaumSatellite.js
│ │ ├── vworld_gray.html
│ │ ├── vworld_street.html
│ │ ├── vworld_satellite.html
│ │ ├── naver_cadastral.html
│ │ ├── naver_satellite.html
│ │ ├── vworld_hybrid.html
│ │ ├── ngii_white.html
│ │ ├── ngii_english.html
│ │ ├── ngii_street.html
│ │ ├── ngii_colorblind.html
│ │ ├── ngii_highdensity.html
│ │ ├── naver_street.html
│ │ ├── naver_hybrid.html
│ │ └── naver_physical.html
│ ├── weblayer_registry.py
│ ├── mango_maps.py
│ ├── vworld_maps.py
│ ├── naver_maps.py
│ ├── daum_maps.py
│ ├── ngii_maps.py
│ ├── naver_maps_old.py
│ └── weblayer.py
├── kml.png
├── x.png
├── openlayers.png
├── qgiscloud.png
├── mActionDraw.png
├── i18n
│ ├── openlayers_de.qm
│ ├── openlayers_en.qm
│ ├── openlayers_es.qm
│ ├── openlayers_fr.qm
│ ├── openlayers_ko.qm
│ └── openlayers_pt_BR.qm
├── mActionAddRasterLayer.png
├── mActionSaveMapAsImage.png
├── update_resources.bat
├── bindogr.py
├── resources.qrc
├── help
│ ├── source
│ │ ├── index.rst
│ │ └── conf.py
│ ├── make.bat
│ └── Makefile
├── about_dialog.py
├── __init__.py
├── ui_openlayersplugin.ui
├── openlayers_plugin_layer_type.py
├── metadata.txt
├── openlayers_overview.py
├── plugin_upload.py
├── ui_openlayers_ovwidget.py
├── ui_openlayers_ovwidget.ui
├── Makefile
└── openlayers_ovwidget.py
├── latest-binary
└── tmsforkorea.zip
├── images
└── tmsforkorea_overview.png
├── .gitattributes
├── README.md
└── .gitignore
/tmsforkorea/weblayers/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tmsforkorea/kml.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/kml.png
--------------------------------------------------------------------------------
/tmsforkorea/x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/x.png
--------------------------------------------------------------------------------
/tmsforkorea/openlayers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/openlayers.png
--------------------------------------------------------------------------------
/tmsforkorea/qgiscloud.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/qgiscloud.png
--------------------------------------------------------------------------------
/latest-binary/tmsforkorea.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/latest-binary/tmsforkorea.zip
--------------------------------------------------------------------------------
/tmsforkorea/mActionDraw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/mActionDraw.png
--------------------------------------------------------------------------------
/images/tmsforkorea_overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/images/tmsforkorea_overview.png
--------------------------------------------------------------------------------
/tmsforkorea/i18n/openlayers_de.qm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/i18n/openlayers_de.qm
--------------------------------------------------------------------------------
/tmsforkorea/i18n/openlayers_en.qm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/i18n/openlayers_en.qm
--------------------------------------------------------------------------------
/tmsforkorea/i18n/openlayers_es.qm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/i18n/openlayers_es.qm
--------------------------------------------------------------------------------
/tmsforkorea/i18n/openlayers_fr.qm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/i18n/openlayers_fr.qm
--------------------------------------------------------------------------------
/tmsforkorea/i18n/openlayers_ko.qm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/i18n/openlayers_ko.qm
--------------------------------------------------------------------------------
/tmsforkorea/i18n/openlayers_pt_BR.qm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/i18n/openlayers_pt_BR.qm
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/icons/kml.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/weblayers/icons/kml.png
--------------------------------------------------------------------------------
/tmsforkorea/mActionAddRasterLayer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/mActionAddRasterLayer.png
--------------------------------------------------------------------------------
/tmsforkorea/mActionSaveMapAsImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/mActionSaveMapAsImage.png
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/icons/daum_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/weblayers/icons/daum_icon.png
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/icons/ngii_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/weblayers/icons/ngii_icon.png
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/icons/mango_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/weblayers/icons/mango_icon.png
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/icons/naver_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/weblayers/icons/naver_icon.png
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/icons/olleh_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/weblayers/icons/olleh_icon.png
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/icons/vworld_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easthobb/qgis-tmsforkorea-plugin/master/tmsforkorea/weblayers/icons/vworld_icon.png
--------------------------------------------------------------------------------
/tmsforkorea/update_resources.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | call "E:\Program Files\QGIS 3.4\bin\o4w_env.bat"
3 | call "E:\Program Files\QGIS 3.4\bin\qt5_env.bat"
4 | call "E:\Program Files\QGIS 3.4\bin\py3_env.bat"
5 |
6 | @echo on
7 | python -m PyQt5.pyrcc_main -o resources_rc.py resources.qrc
8 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/qgis.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | }
4 | #map {
5 | width: 100%;
6 | height: 100%;
7 | }
8 | .olControlAttribution {
9 | font-size: smaller;
10 | right: 3px;
11 | bottom: 0.5em;
12 | position: absolute;
13 | display: block;
14 | }
15 | /* avoid pink tiles */
16 | .olImageLoadError {
17 | background-color: transparent !important;
18 | }
19 |
--------------------------------------------------------------------------------
/tmsforkorea/bindogr.py:
--------------------------------------------------------------------------------
1 | from osgeo import ogr, osr
2 |
3 |
4 | def __getSpatialRefProj4(sProj4):
5 | sr = osr.SpatialReference()
6 | sr.ImportFromProj4(sProj4)
7 | return sr
8 |
9 |
10 | def initOgr():
11 | ogr.RegisterAll()
12 |
13 |
14 | def exportKml(wkt, proj4):
15 | geom = ogr.CreateGeometryFromWkt(wkt)
16 | sr = __getSpatialRefProj4(proj4)
17 | geom.AssignSpatialReference(sr)
18 | return geom.ExportToKML()
19 |
--------------------------------------------------------------------------------
/tmsforkorea/resources.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | openlayers.png
4 | qgiscloud.png
5 | weblayers/icons/kml.png
6 | weblayers/icons/daum_icon.png
7 | weblayers/icons/naver_icon.png
8 | weblayers/icons/olleh_icon.png
9 | weblayers/icons/vworld_icon.png
10 | weblayers/icons/ngii_icon.png
11 | weblayers/icons/mango_icon.png
12 |
13 |
--------------------------------------------------------------------------------
/tmsforkorea/help/source/index.rst:
--------------------------------------------------------------------------------
1 | .. openlayersplugin documentation master file, created by
2 | sphinx-quickstart on Sun Feb 12 17:11:03 2012.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | Welcome to openlayersplugin's documentation!
7 | ============================================
8 |
9 | Contents:
10 |
11 | .. toctree::
12 | :maxdepth: 2
13 |
14 | Indices and tables
15 | ==================
16 |
17 | * :ref:`genindex`
18 | * :ref:`modindex`
19 | * :ref:`search`
20 |
21 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/tmsforkorea/about_dialog.py:
--------------------------------------------------------------------------------
1 | from qgis.PyQt.QtWidgets import QDialog
2 | from .ui_about_dialog import Ui_dlgAbout
3 |
4 |
5 | class AboutDialog(QDialog, Ui_dlgAbout):
6 | def __init__(self):
7 | QDialog.__init__(self)
8 | # Set up the user interface from Designer.
9 | # After setupUI you can access any designer object by doing
10 | # self., and you can use autoconnect slots - see
11 | # http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html
12 | # #widgets-and-dialogs-with-auto-connect
13 | self.setupUi(self)
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | TMS for Korea
2 | =======================
3 |
4 |
5 | QGIS TMS Plugin for Korean users
6 | ------------------------------
7 | - Daum(Street, Satellite, Hybrid, Physical, Cadstral) Maps
8 | - Naver(Street, Satellite, Hybrid, Physical, Cadstral) Maps
9 | - VWorld(Street, Gray, Satellite, Hybrid) Maps
10 | - NGII(Street, Blank, Color-Blind, High-Density, English Version)
11 |
12 |
13 | Plugins Repository
14 | ------------------------------
15 | - http://plugins.qgis.org/plugins/tmsforkorea/
16 |
17 | Related Projects
18 | ------------------------------
19 | - ported from qgis-openlayers-plugin[https://github.com/sourcepole/qgis-openlayers-plugin]
20 |
21 | License
22 | ----------
23 | - tmsforkorea plugin is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
24 |
25 | Gallery
26 | ---------
27 |
28 | 
29 |
30 |
--------------------------------------------------------------------------------
/tmsforkorea/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | OpenLayers Plugin
5 | A QGIS plugin
6 |
7 | -------------------
8 | begin : 2009-11-30
9 | copyright : (C) 2009 by Pirmin Kalberer, Sourcepole
10 | email : pka at sourcepole.ch
11 | ***************************************************************************/
12 |
13 | /***************************************************************************
14 | * *
15 | * This program is free software; you can redistribute it and/or modify *
16 | * it under the terms of the GNU General Public License as published by *
17 | * the Free Software Foundation; either version 2 of the License, or *
18 | * (at your option) any later version. *
19 | * *
20 | ***************************************************************************/
21 | This script initializes the plugin, making it known to QGIS.
22 | """
23 |
24 |
25 | def classFactory(iface):
26 | from .openlayers_plugin import OpenlayersPlugin
27 | return OpenlayersPlugin(iface)
28 |
--------------------------------------------------------------------------------
/tmsforkorea/ui_openlayersplugin.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | OpenlayersPlugin
4 |
5 |
6 |
7 | 0
8 | 0
9 | 400
10 | 300
11 |
12 |
13 |
14 | OpenlayersPlugin
15 |
16 |
17 |
18 |
19 | 30
20 | 240
21 | 341
22 | 32
23 |
24 |
25 |
26 | Qt::Horizontal
27 |
28 |
29 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok
30 |
31 |
32 |
33 |
34 |
35 |
36 | buttonBox
37 | accepted()
38 | OpenlayersPlugin
39 | accept()
40 |
41 |
42 | 248
43 | 254
44 |
45 |
46 | 157
47 | 274
48 |
49 |
50 |
51 |
52 | buttonBox
53 | rejected()
54 | OpenlayersPlugin
55 | reject()
56 |
57 |
58 | 316
59 | 260
60 |
61 |
62 | 286
63 | 274
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/tmsforkorea/openlayers_plugin_layer_type.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | OpenLayers Plugin
5 | A QGIS plugin
6 |
7 | -------------------
8 | begin : 2010-02-03
9 | copyright : (C) 2010 by Pirmin Kalberer, Sourcepole
10 | email : pka at sourcepole.ch
11 | ***************************************************************************/
12 |
13 | /***************************************************************************
14 | * *
15 | * This program is free software; you can redistribute it and/or modify *
16 | * it under the terms of the GNU General Public License as published by *
17 | * the Free Software Foundation; either version 2 of the License, or *
18 | * (at your option) any later version. *
19 | * *
20 | ***************************************************************************/
21 | """
22 | from qgis.core import QgsPluginLayerType
23 | from .openlayers_layer import OpenlayersLayer
24 |
25 |
26 | class OpenlayersPluginLayerType(QgsPluginLayerType):
27 |
28 | def __init__(self, iface, add_callback, olLayerTypeRegistry):
29 | QgsPluginLayerType.__init__(self, OpenlayersLayer.LAYER_TYPE)
30 | self.iface = iface
31 | self.add_callback = add_callback
32 | self.olLayerTypeRegistry = olLayerTypeRegistry
33 |
34 | def createLayer(self):
35 | layer = OpenlayersLayer(self.iface, self.olLayerTypeRegistry)
36 | self.add_callback(layer)
37 | return layer
38 |
39 | def showLayerProperties(self, layer):
40 | return False
41 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/daum_street.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers DaumStreet Layer
5 |
6 |
7 |
8 |
9 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/naver_street_5179.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers NaverStreet Layer
5 |
6 |
7 |
8 |
9 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/naver_hybrid_5179.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers NaverHybrid Layer
5 |
6 |
7 |
8 |
9 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/naver_physical_5179.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers Physical Layer
5 |
6 |
7 |
8 |
9 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/daum_cadastral.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers DaumCadstral Layer
5 |
6 |
7 |
8 |
9 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/daum_satellite.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers DaumSatellite Layer
5 |
6 |
7 |
8 |
9 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/naver_satellite_5179.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers NaverSatellite Layer
5 |
6 |
7 |
8 |
9 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/naver_cadastral_5179.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers NaverCadstral Layer
5 |
6 |
7 |
8 |
9 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/tmsforkorea/metadata.txt:
--------------------------------------------------------------------------------
1 | [general]
2 | name=TMS for Korea
3 | qgisMinimumVersion=3.10.0
4 | description=QGIS plugin. Kakao(Daum), Naver, VWorld, NGII Map Layers for Korean users
5 | about=QGIS plugin. Kakao(Daum), Naver, VWorld, NGII Map Layers for Korean users
6 | version=3.0.0
7 |
8 | # tags are comma separated with spaces allowed
9 | tags=openlayers, kakao, naver, vworld, ngii
10 |
11 | homepage=http://www.onspatial.com/2013/02/qgis-tms-for-korean-users-plugin.html
12 | tracker=http://hub.qgis.org/projects/tmsforkorea
13 | repository=https://github.com/MapPlus/qgis-tmsforkorea-plugin.git
14 | icon=openlayers.png
15 |
16 | # experimental flag
17 | experimental=False
18 |
19 | # deprecated flag (applies to the whole plugin, not just a single version
20 | deprecated=False
21 |
22 | # Author contact information
23 | author=Minpa Lee
24 | email=mapplus@gmail.com
25 |
26 | # Uncomment the following line and add your changelog entries:
27 | changelog=
28 | 3.0.0
29 | - The first release of the QGIS 3.10 version.
30 | - Update Kakao(Daum), Naver, VWorld Maps
31 | - Support Naver Maps v5
32 | 2.0.0
33 | - The first release of the QGIS 3.4 version.
34 | - Ported from OpenLayers Plugin 2.0.0, Special thanks to OpenLayers Plugin Team(Sourcepole and contributors).
35 | 1.5.1
36 | - Update Daum, Naver, VWorld, Olleh KT Maps
37 | 1.5.0
38 | - Added Daum Cadstral & Olleh Cadstral layers
39 | 1.4.0
40 | - Added NGII(Street, Blank, Color-Blind, High-Density, English Version) layers
41 | 1.3.0
42 | - Update Daum Maps
43 | 1.2.1
44 | - Update VWorld Maps
45 | 1.2.0
46 | - Update Daum, Naver, Olleh Maps
47 | 1.1.0
48 | - Update Daum, Naver, Olleh Maps
49 | 1.0.1
50 | - Update Daum, Naver Maps
51 | 1.0.0
52 | - The first release of the QGIS 2.4 version.
53 | - Ported from OpenLayers Plugin 1.3.3, Special thanks to Pirmin Kalberer, Sourcepole.
54 | 0.5.2
55 | - Final version for QGIS 2.2
56 | 0.5.1
57 | - Added VWorld(Satellite, Hybrid) layers
58 | 0.5.0
59 | - Support for QGIS 2.0. This is the first release of the QGIS 2.x series.
60 | 0.4.1
61 | - Added VWorld(Satellite, Hybrid) layers
62 | 0.4.0
63 | - Added VWorld(Street) layers
64 | 0.3.0
65 | - Added Olleh KT(Street, Satellite, Hybrid) layers
66 | 0.2.0
67 | - Added Daum(Hybrid, Physical) layers, Fixed some bugs
68 | 0.1.0
69 | - Added Daum(Street, Satellite), Naver(Street, Satellite, Hybrid, Cadstral) layers
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/OpenLayers.Layer.DaumHybrid.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
2 | * full list of contributors). Published under the 2-clause BSD license.
3 | * See license.txt in the OpenLayers distribution or repository for the
4 | * full text of the license. */
5 |
6 | /**
7 | * @requires OpenLayers/Layer/XYZ.js
8 | */
9 |
10 | OpenLayers.Layer.DaumHybrid = OpenLayers.Class(OpenLayers.Layer.XYZ, {
11 |
12 | name: "Daum Hybrid Map",
13 | url: [
14 | "http://map0.daumcdn.net/map_hybrid/1912uow/L${z}/${y}/${x}.png",
15 | "http://map1.daumcdn.net/map_hybrid/1912uow/L${z}/${y}/${x}.png",
16 | "http://map2.daumcdn.net/map_hybrid/1912uow/L${z}/${y}/${x}.png",
17 | "http://map3.daumcdn.net/map_hybrid/1912uow/L${z}/${y}/${x}.png"
18 | ],
19 | resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
20 | sphericalMercator: false,
21 | buffer: 1,
22 | numZoomLevels: 14,
23 | minResolution: 0.25,
24 | maxResolution: 2048,
25 | units: "m",
26 | projection: new OpenLayers.Projection("EPSG:5181"),
27 | displayOutsideMaxExtent: true,
28 | maxExtent: new OpenLayers.Bounds(-30000, -60000, 494288, 988576),
29 | initialize: function(name, options) {
30 | if (!options) options = {resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25]};
31 | else if (!options.resolutions) options.resolutions = [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25];
32 | var newArgs = [name, null, options];
33 | OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs);
34 | },
35 | clone: function(obj) {
36 | if (obj == null) {
37 | obj = new OpenLayers.Layer.DaumHybrid(
38 | this.name, this.getOptions());
39 | }
40 | obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
41 | return obj;
42 | },
43 |
44 | getXYZ: function(bounds) {
45 | var res = this.getServerResolution();
46 | var x = Math.round((bounds.left - this.maxExtent.left) /
47 | (res * this.tileSize.w));
48 | var y = Math.round((bounds.bottom - this.maxExtent.bottom) /
49 | (res * this.tileSize.h));
50 | var z = this.numZoomLevels - this.getServerZoom();
51 |
52 | if (this.wrapDateLine) {
53 | var limit = Math.pow(2, z);
54 | x = ((x % limit) + limit) % limit;
55 | }
56 |
57 | return {'x': x, 'y': y, 'z': z};
58 | },
59 |
60 | CLASS_NAME: "OpenLayers.Layer.DaumHybrid"
61 | });
62 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/daum_hybrid.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers DaumHybrid Layer
5 |
6 |
7 |
8 |
9 |
10 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/mango_base.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Mango BaseMap Layer
5 |
6 |
7 |
8 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/mango_base_gray.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Mango BaseMap Gray Layer
5 |
6 |
7 |
8 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/mango_hidpi.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Mango BaseMap HiDPI Layer
5 |
6 |
7 |
8 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/mango_hidpi_gray.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Mango BaseMap HiDPI Gray Layer
5 |
6 |
7 |
8 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/daum_physical.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers DaumPhysical Layer
5 |
6 |
7 |
8 |
9 |
10 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/OlOverviewMarker.js:
--------------------------------------------------------------------------------
1 | /*
2 | ****************************************************************************
3 | Operlayer Overview Marker
4 | -------------------
5 | begin : 2010-03-03
6 | copyright : (C) 2010 by Luiz Motta
7 | email : motta.luiz at gamil.com
8 | ****************************************************************************
9 |
10 | ****************************************************************************
11 | * *
12 | * This program is free software; you can redistribute it and/or modify *
13 | * it under the terms of the GNU General Public License as published by *
14 | * the Free Software Foundation; either version 2 of the License, or *
15 | * (at your option) any later version. *
16 | * *
17 | ***************************************************************************
18 |
19 | Dependences:
20 | Libray: OpenLayers.js and MarkerCursorQGis(Python binding - @QtCore.pyqtSlot(str) )
21 |
22 | Usage:
23 | Inside HTML:
24 | var oloMarker;
25 | // Inside init function by HTML()
26 | oloMarker = OlOverviewMarker(map, getPathUpper(document.URL) + '/x.png') // x.png in upper directory of HTML
27 | Inside Python:
28 | evaluateJavaScript("oloMarker.changeMarker();")
29 |
30 | *****************************************************************************/
31 |
32 | function getPathUpper(url)
33 | {
34 | var paths = new Array();
35 | paths = document.URL.split('/');
36 | paths.pop();paths.pop();
37 | return paths.join('/');
38 | }
39 |
40 | function OlOverviewMarker(map, urlIcon) {
41 | //Private
42 | function __createMarker(urlIcon)
43 | {
44 | var size = new OpenLayers.Size(16,16);
45 | var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
46 | var icon = new OpenLayers.Icon(urlIcon, size, offset);
47 | marker = new OpenLayers.Marker(new OpenLayers.LonLat(0,0), icon);
48 | marker.display(false);
49 | }
50 | //Public CTRL+Q
51 | this.changeMarker = function() {
52 | this.lyrMarker.removeMarker(marker);
53 | var extent = this.map.getExtent();
54 | marker.lonlat = extent.getCenterLonLat();
55 | marker.display(true);
56 | this.lyrMarker.addMarker(marker);
57 | MarkerCursorQGis.changeMarker(extent.toArray().toString());
58 | };
59 | this.map = map;
60 | var marker;
61 | __createMarker(urlIcon);
62 | this.lyrMarker = new OpenLayers.Layer.Markers("Marker Overview");
63 | this.lyrMarker.addMarker(marker);
64 | map.addLayer(this.lyrMarker);
65 | }
66 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/OpenLayers.Layer.NaverStreet.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
2 | * full list of contributors). Published under the 2-clause BSD license.
3 | * See license.txt in the OpenLayers distribution or repository for the
4 | * full text of the license. */
5 |
6 | /**
7 | * @requires OpenLayers/Layer/XYZ.js
8 | */
9 |
10 | OpenLayers.Layer.NaverStreet = OpenLayers.Class(OpenLayers.Layer.XYZ, {
11 |
12 | name: "NaverStreetMap",
13 | url: [
14 | "https://simg.pstatic.net/onetile/get/196/0/0/${z}/${x}/${y}/bl_vc_bg/ol_vc_an"
15 | ],
16 | resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
17 | attribution: '© '
18 | + 'NHN Corp.'
19 | + '
',
20 | sphericalMercator: false,
21 | buffer: 0,
22 | numZoomLevels: 14,
23 | minResolution: 0.25,
24 | maxResolution: 2048,
25 | units: "m",
26 | projection: new OpenLayers.Projection("EPSG:5179"),
27 | displayOutsideMaxExtent: false,
28 | maxExtent: new OpenLayers.Bounds(90112, 1192896, 1990673, 2761664),
29 | initialize: function(name, options) {
30 | if (!options) options = {resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25]};
31 | else if (!options.resolutions) options.resolutions = [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25];
32 | var newArgs = [name, null, options];
33 | OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs);
34 | },
35 | clone: function(obj) {
36 | if (obj == null) {
37 | obj = new OpenLayers.Layer.NaverStreet(
38 | this.name, this.getOptions());
39 | }
40 | obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
41 | return obj;
42 | },
43 |
44 | getXYZ: function(bounds) {
45 | var res = this.getServerResolution();
46 | var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
47 | var y = Math.round((bounds.bottom - this.maxExtent.bottom) / (res * this.tileSize.h));
48 | var z = this.getServerZoom() + 1;
49 |
50 | if (this.wrapDateLine) {
51 | var limit = Math.pow(2, z);
52 | x = ((x % limit) + limit) % limit;
53 | }
54 |
55 | return {'x': x, 'y': y, 'z': z};
56 | },
57 |
58 | CLASS_NAME: "OpenLayers.Layer.NaverStreet"
59 | });
60 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/OpenLayers.Layer.NaverPhysical.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
2 | * full list of contributors). Published under the 2-clause BSD license.
3 | * See license.txt in the OpenLayers distribution or repository for the
4 | * full text of the license. */
5 |
6 | /**
7 | * @requires OpenLayers/Layer/XYZ.js
8 | */
9 |
10 | OpenLayers.Layer.NaverPhysical = OpenLayers.Class(OpenLayers.Layer.XYZ, {
11 |
12 | name: "NaverPhysicalMap",
13 | url: [
14 | "https://simg.pstatic.net/onetile/get/196/0/0/${z}/${x}/${y}/bl_tn_bg/ol_vc_bg/ol_vc_an"
15 | ],
16 | resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
17 | attribution: '© '
18 | + 'NHN Corp.'
19 | + '
',
20 | sphericalMercator: false,
21 | buffer: 0,
22 | numZoomLevels: 14,
23 | minResolution: 0.25,
24 | maxResolution: 2048,
25 | units: "m",
26 | projection: new OpenLayers.Projection("EPSG:5179"),
27 | displayOutsideMaxExtent: false,
28 | maxExtent: new OpenLayers.Bounds(90112, 1192896, 1990673, 2761664),
29 | initialize: function(name, options) {
30 | if (!options) options = {resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25]};
31 | else if (!options.resolutions) options.resolutions = [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25];
32 | var newArgs = [name, null, options];
33 | OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs);
34 | },
35 | clone: function(obj) {
36 | if (obj == null) {
37 | obj = new OpenLayers.Layer.NaverPhysical(
38 | this.name, this.getOptions());
39 | }
40 | obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
41 | return obj;
42 | },
43 |
44 | getXYZ: function(bounds) {
45 | var res = this.getServerResolution();
46 | var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
47 | var y = Math.round((bounds.bottom - this.maxExtent.bottom) / (res * this.tileSize.h));
48 | var z = this.getServerZoom() + 1;
49 |
50 | if (this.wrapDateLine) {
51 | var limit = Math.pow(2, z);
52 | x = ((x % limit) + limit) % limit;
53 | }
54 |
55 | return {'x': x, 'y': y, 'z': z};
56 | },
57 |
58 | CLASS_NAME: "OpenLayers.Layer.NaverPhysical"
59 | });
60 |
--------------------------------------------------------------------------------
/tmsforkorea/openlayers_overview.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | Openlayers Overview - A QGIS plugin to show map in browser(google maps and others)
5 | -------------------
6 | begin : 2011-03-01
7 | copyright : (C) 2011 by Luiz Motta
8 | author : Luiz P. Motta
9 | email : motta _dot_ luiz _at_ gmail.com
10 | ***************************************************************************/
11 |
12 | /***************************************************************************
13 | * *
14 | * This program is free software; you can redistribute it and/or modify *
15 | * it under the terms of the GNU General Public License as published by *
16 | * the Free Software Foundation; either version 2 of the License, or *
17 | * (at your option) any later version. *
18 | * *
19 | ***************************************************************************/
20 | """
21 | from qgis.PyQt.QtCore import Qt
22 | from qgis.PyQt.QtWidgets import QApplication, QDockWidget
23 | from .openlayers_ovwidget import OpenLayersOverviewWidget
24 |
25 |
26 | class OLOverview(object):
27 |
28 | def __init__(self, iface, olLayerTypeRegistry):
29 | self._iface = iface
30 | self._olLayerTypeRegistry = olLayerTypeRegistry
31 | self._dockwidget = None
32 | self._oloWidget = None
33 |
34 | # Private
35 | def _setDocWidget(self):
36 | self._dockwidget = QDockWidget(QApplication.translate(
37 | "OpenLayersOverviewWidget", "OpenLayers Overview"),
38 | self._iface.mainWindow())
39 | self._dockwidget.setObjectName("dwOpenlayersOverview")
40 | self._oloWidget = OpenLayersOverviewWidget(self._iface,
41 | self._dockwidget,
42 | self._olLayerTypeRegistry)
43 | self._dockwidget.setWidget(self._oloWidget)
44 |
45 | def _initGui(self):
46 | self._setDocWidget()
47 | self._iface.addDockWidget(Qt.LeftDockWidgetArea, self._dockwidget)
48 |
49 | def _unload(self):
50 | self._dockwidget.close()
51 | self._iface.removeDockWidget(self._dockwidget)
52 | del self._oloWidget
53 | self._dockwidget = None
54 |
55 | # Public
56 | def setVisible(self, visible):
57 | if visible:
58 | if self._dockwidget is None:
59 | self._initGui()
60 | else:
61 | if self._dockwidget is not None:
62 | self._unload()
63 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/OpenLayers.Layer.NaverHybrid.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
2 | * full list of contributors). Published under the 2-clause BSD license.
3 | * See license.txt in the OpenLayers distribution or repository for the
4 | * full text of the license. */
5 |
6 | /**
7 | * @requires OpenLayers/Layer/XYZ.js
8 | */
9 |
10 | OpenLayers.Layer.NaverHybrid = OpenLayers.Class(OpenLayers.Layer.XYZ, {
11 |
12 | name: "NaverHybridMap",
13 | url: [
14 | "https://simg.pstatic.net/onetile/get/196/0/0/${z}/${x}/${y}/empty/ol_st_rd/ol_st_an"
15 | ],
16 | resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
17 | attribution: '© '
18 | + 'NHN Corp.'
19 | + '
',
20 | sphericalMercator: false,
21 | buffer: 0,
22 | numZoomLevels: 14,
23 | minResolution: 0.25,
24 | maxResolution: 2048,
25 | units: "m",
26 | projection: new OpenLayers.Projection("EPSG:5179"),
27 | displayOutsideMaxExtent: false,
28 | maxExtent: new OpenLayers.Bounds(90112, 1192896, 1990673, 2761664),
29 | initialize: function(name, options) {
30 | if (!options) options = {resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25]};
31 | else if (!options.resolutions) options.resolutions = [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25];
32 | var newArgs = [name, null, options];
33 | OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs);
34 | },
35 | clone: function(obj) {
36 | if (obj == null) {
37 | obj = new OpenLayers.Layer.NaverHybrid(
38 | this.name, this.getOptions());
39 | }
40 | obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
41 | return obj;
42 | },
43 |
44 | getXYZ: function(bounds) {
45 | var res = this.getServerResolution();
46 | var x = Math.round((bounds.left - this.maxExtent.left) /
47 | (res * this.tileSize.w));
48 | var y = Math.round((bounds.bottom - this.maxExtent.bottom) /
49 | (res * this.tileSize.h));
50 | var z = this.getServerZoom() + 1;
51 |
52 | if (this.wrapDateLine) {
53 | var limit = Math.pow(2, z);
54 | x = ((x % limit) + limit) % limit;
55 | }
56 |
57 | return {'x': x, 'y': y, 'z': z};
58 | },
59 |
60 | CLASS_NAME: "OpenLayers.Layer.NaverHybrid"
61 | });
62 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/OpenLayers.Layer.NaverSatellite.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
2 | * full list of contributors). Published under the 2-clause BSD license.
3 | * See license.txt in the OpenLayers distribution or repository for the
4 | * full text of the license. */
5 |
6 | /**
7 | * @requires OpenLayers/Layer/XYZ.js
8 | */
9 |
10 | OpenLayers.Layer.NaverSatellite = OpenLayers.Class(OpenLayers.Layer.XYZ, {
11 |
12 | name: "NaverSatelliteMap",
13 | url: [
14 | "https://simg.pstatic.net/onetile/get/196/0/1/${z}/${x}/${y}/bl_st_bg"
15 | ],
16 | resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
17 | attribution: '© '
18 | + 'NHN Corp.'
19 | + '
',
20 | sphericalMercator: false,
21 | buffer: 0,
22 | numZoomLevels: 14,
23 | minResolution: 0.25,
24 | maxResolution: 2048,
25 | units: "m",
26 | projection: new OpenLayers.Projection("EPSG:5179"),
27 | displayOutsideMaxExtent: false,
28 | maxExtent: new OpenLayers.Bounds(90112, 1192896, 1990673, 2761664),
29 | initialize: function(name, options) {
30 | if (!options) options = {resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25]};
31 | else if (!options.resolutions) options.resolutions = [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25];
32 | var newArgs = [name, null, options];
33 | OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs);
34 | },
35 | clone: function(obj) {
36 | if (obj == null) {
37 | obj = new OpenLayers.Layer.NaverSatellite(
38 | this.name, this.getOptions());
39 | }
40 | obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
41 | return obj;
42 | },
43 |
44 | getXYZ: function(bounds) {
45 | var res = this.getServerResolution();
46 | var x = Math.round((bounds.left - this.maxExtent.left) /
47 | (res * this.tileSize.w));
48 | var y = Math.round((bounds.bottom - this.maxExtent.bottom) /
49 | (res * this.tileSize.h));
50 | var z = this.getServerZoom() + 1;
51 |
52 | if (this.wrapDateLine) {
53 | var limit = Math.pow(2, z);
54 | x = ((x % limit) + limit) % limit;
55 | }
56 |
57 | return {'x': x, 'y': y, 'z': z};
58 | },
59 |
60 | CLASS_NAME: "OpenLayers.Layer.NaverSatellite"
61 | });
62 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/OpenLayers.Layer.NaverCadstral.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
2 | * full list of contributors). Published under the 2-clause BSD license.
3 | * See license.txt in the OpenLayers distribution or repository for the
4 | * full text of the license. */
5 |
6 | /**
7 | * @requires OpenLayers/Layer/XYZ.js
8 | */
9 |
10 | OpenLayers.Layer.NaverCadstral = OpenLayers.Class(OpenLayers.Layer.XYZ, {
11 |
12 | name: "NaverCadstralMap",
13 | url: [
14 | "https://simg.pstatic.net/onetile/get/196/0/0/${z}/${x}/${y}/empty/ol_lp_cn"
15 | ],
16 | resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
17 | attribution: '© '
18 | + 'NHN Corp.'
19 | + '
',
20 | sphericalMercator: false,
21 | buffer: 0,
22 | numZoomLevels: 14,
23 | minResolution: 0.25,
24 | maxResolution: 2048,
25 | units: "m",
26 | projection: new OpenLayers.Projection("EPSG:5179"),
27 | displayOutsideMaxExtent: false,
28 | maxExtent: new OpenLayers.Bounds(90112, 1192896, 1990673, 2761664),
29 | initialize: function(name, options) {
30 | if (!options) options = {resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25]};
31 | else if (!options.resolutions) options.resolutions = [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25];
32 | var newArgs = [name, null, options];
33 | OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs);
34 | },
35 | clone: function(obj) {
36 | if (obj == null) {
37 | obj = new OpenLayers.Layer.NaverCadstral(
38 | this.name, this.getOptions());
39 | }
40 | obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
41 | return obj;
42 | },
43 |
44 | getXYZ: function(bounds) {
45 | var res = this.getServerResolution();
46 | var x = Math.round((bounds.left - this.maxExtent.left) /
47 | (res * this.tileSize.w));
48 | var y = Math.round((bounds.bottom - this.maxExtent.bottom) /
49 | (res * this.tileSize.h));
50 | var z = this.getServerZoom() + 1;
51 |
52 | if (this.wrapDateLine) {
53 | var limit = Math.pow(2, z);
54 | x = ((x % limit) + limit) % limit;
55 | }
56 |
57 | return {'x': x, 'y': y, 'z': z};
58 | },
59 |
60 | CLASS_NAME: "OpenLayers.Layer.NaverCadstral"
61 | });
62 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/weblayer_registry.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | OpenLayers Plugin
5 | A QGIS plugin
6 |
7 | -------------------
8 | begin : 2009-11-30
9 | copyright : (C) 2009 by Pirmin Kalberer, Sourcepole
10 | email : pka at sourcepole.ch
11 | ***************************************************************************/
12 |
13 | /***************************************************************************
14 | * *
15 | * This program is free software; you can redistribute it and/or modify *
16 | * it under the terms of the GNU General Public License as published by *
17 | * the Free Software Foundation; either version 2 of the License, or *
18 | * (at your option) any later version. *
19 | * *
20 | ***************************************************************************/
21 | """
22 |
23 | from .weblayer import WebLayerGroup
24 |
25 |
26 | class WebLayerTypeRegistry:
27 | """Registry of OL web Layers"""
28 | def __init__(self, plugin):
29 | self._plugin = plugin
30 | self._groups = {}
31 | self._olLayerTypes = {}
32 | self._layerTypeId = 0 # Sequence for ID
33 | self._olLayerTypeNames = {}
34 |
35 | def group(self, name, icon):
36 | """Create group and register in registry"""
37 | if name not in self._groups:
38 | self._groups[name] = WebLayerGroup(name, icon)
39 | return self._groups[name]
40 |
41 | def groups(self):
42 | return self._groups.values()
43 |
44 | def register(self, layerType):
45 | layerType.group = self.group(layerType.groupName, layerType.groupIcon)
46 | layerType.setAddLayerCallback(self._plugin.addLayer)
47 | layerType.layerTypeId = self._layerTypeId
48 | self._olLayerTypes[self._layerTypeId] = layerType
49 | self._layerTypeId += 1
50 | self._olLayerTypeNames[layerType.layerTypeName] = layerType
51 |
52 | def types(self):
53 | return self._olLayerTypes.values()
54 |
55 | def getById(self, id):
56 | if id in self._olLayerTypes:
57 | return self._olLayerTypes[id]
58 | else:
59 | return None
60 |
61 | def getByName(self, name):
62 | if name in self._olLayerTypeNames:
63 | return self._olLayerTypeNames[name]
64 | else:
65 | return None
66 |
67 | def groupLayerTypes(self, group):
68 | lst = []
69 | for lyr in self.types():
70 | if lyr.group == group:
71 | lst.append(lyr)
72 | return lst
73 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .metadata
8 | bin/
9 | tmp/
10 | *.tmp
11 | *.bak
12 | *.swp
13 | *~.nib
14 | local.properties
15 | .classpath
16 | .settings/
17 | .loadpath
18 |
19 | # External tool builders
20 | .externalToolBuilders/
21 |
22 | # Locally stored "Eclipse launch configurations"
23 | *.launch
24 |
25 | # CDT-specific
26 | .cproject
27 |
28 | # PDT-specific
29 | .buildpath
30 |
31 |
32 | #################
33 | ## Visual Studio
34 | #################
35 |
36 | ## Ignore Visual Studio temporary files, build results, and
37 | ## files generated by popular Visual Studio add-ons.
38 |
39 | # User-specific files
40 | *.suo
41 | *.user
42 | *.sln.docstates
43 |
44 | # Build results
45 | [Dd]ebug/
46 | [Rr]elease/
47 | *_i.c
48 | *_p.c
49 | *.ilk
50 | *.meta
51 | *.obj
52 | *.pch
53 | *.pdb
54 | *.pgc
55 | *.pgd
56 | *.rsp
57 | *.sbr
58 | *.tlb
59 | *.tli
60 | *.tlh
61 | *.tmp
62 | *.vspscc
63 | .builds
64 | *.dotCover
65 |
66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this
67 | #packages/
68 |
69 | # Visual C++ cache files
70 | ipch/
71 | *.aps
72 | *.ncb
73 | *.opensdf
74 | *.sdf
75 |
76 | # Visual Studio profiler
77 | *.psess
78 | *.vsp
79 |
80 | # ReSharper is a .NET coding add-in
81 | _ReSharper*
82 |
83 | # Installshield output folder
84 | [Ee]xpress
85 |
86 | # DocProject is a documentation generator add-in
87 | DocProject/buildhelp/
88 | DocProject/Help/*.HxT
89 | DocProject/Help/*.HxC
90 | DocProject/Help/*.hhc
91 | DocProject/Help/*.hhk
92 | DocProject/Help/*.hhp
93 | DocProject/Help/Html2
94 | DocProject/Help/html
95 |
96 | # Click-Once directory
97 | publish
98 |
99 | # Others
100 | [Bb]in
101 | [Oo]bj
102 | sql
103 | TestResults
104 | *.Cache
105 | ClientBin
106 | stylecop.*
107 | ~$*
108 | *.dbmdl
109 | Generated_Code #added for RIA/Silverlight projects
110 |
111 | # Backup & report files from converting an old project file to a newer
112 | # Visual Studio version. Backup files are not needed, because we have git ;-)
113 | _UpgradeReport_Files/
114 | Backup*/
115 | UpgradeLog*.XML
116 |
117 |
118 |
119 | ############
120 | ## Windows
121 | ############
122 |
123 | # Windows image file caches
124 | Thumbs.db
125 |
126 | # Folder config file
127 | Desktop.ini
128 |
129 |
130 | #############
131 | ## Python
132 | #############
133 |
134 | *.py[co]
135 |
136 | # Packages
137 | *.egg
138 | *.egg-info
139 | dist
140 | build
141 | eggs
142 | parts
143 | bin
144 | var
145 | sdist
146 | develop-eggs
147 | .installed.cfg
148 |
149 | # Installer logs
150 | pip-log.txt
151 |
152 | # Unit test / coverage reports
153 | .coverage
154 | .tox
155 |
156 | #Translations
157 | *.mo
158 |
159 | #Mr Developer
160 | .mr.developer.cfg
161 |
162 | # Mac crap
163 | .DS_Store
164 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/OpenLayers.Layer.DaumStreet.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
2 | * full list of contributors). Published under the 2-clause BSD license.
3 | * See license.txt in the OpenLayers distribution or repository for the
4 | * full text of the license. */
5 |
6 | /**
7 | * @requires OpenLayers/Layer/XYZ.js
8 | */
9 |
10 | OpenLayers.Layer.DaumStreet = OpenLayers.Class(OpenLayers.Layer.XYZ, {
11 |
12 | name: "Daum Street Map",
13 | url: [
14 | "http://map0.daumcdn.net/map_2d/1912uow/L${z}/${y}/${x}.png",
15 | "http://map1.daumcdn.net/map_2d/1912uow/L${z}/${y}/${x}.png",
16 | "http://map2.daumcdn.net/map_2d/1912uow/L${z}/${y}/${x}.png",
17 | "http://map3.daumcdn.net/map_2d/1912uow/L${z}/${y}/${x}.png"
18 | ],
19 | resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
20 | attribution: ''
23 | + 'ⓒ Daum',
24 | sphericalMercator: false,
25 | buffer: 1,
26 | numZoomLevels: 14,
27 | minResolution: 0.25,
28 | maxResolution: 2048,
29 | units: "m",
30 | projection: new OpenLayers.Projection("EPSG:5181"),
31 | displayOutsideMaxExtent: true,
32 | maxExtent: new OpenLayers.Bounds(-30000, -60000, 494288, 988576),
33 | initialize: function(name, options) {
34 | if (!options) options = {resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25]};
35 | else if (!options.resolutions) options.resolutions = [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25];
36 | var newArgs = [name, null, options];
37 | OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs);
38 | },
39 | clone: function(obj) {
40 | if (obj == null) {
41 | obj = new OpenLayers.Layer.DaumStreet(
42 | this.name, this.getOptions());
43 | }
44 | obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
45 | return obj;
46 | },
47 |
48 | getXYZ: function(bounds) {
49 | var res = this.getServerResolution();
50 | var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
51 | var y = Math.round((bounds.bottom - this.maxExtent.bottom) / (res * this.tileSize.h));
52 | var z = this.numZoomLevels - this.getServerZoom();
53 |
54 | if (this.wrapDateLine) {
55 | var limit = Math.pow(2, z);
56 | x = ((x % limit) + limit) % limit;
57 | }
58 |
59 | return {'x': x, 'y': y, 'z': z};
60 | },
61 |
62 | CLASS_NAME: "OpenLayers.Layer.DaumStreet"
63 | });
64 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/OpenLayers.Layer.DaumCadstral.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
2 | * full list of contributors). Published under the 2-clause BSD license.
3 | * See license.txt in the OpenLayers distribution or repository for the
4 | * full text of the license. */
5 |
6 | /**
7 | * @requires OpenLayers/Layer/XYZ.js
8 | */
9 |
10 | OpenLayers.Layer.DaumCadstral = OpenLayers.Class(OpenLayers.Layer.XYZ, {
11 |
12 | name: "Daum Cadstral Map",
13 | url: [
14 | "http://map0.daumcdn.net/map_usedistrict/1912uow/L${z}/${y}/${x}.png",
15 | "http://map1.daumcdn.net/map_usedistrict/1912uow/L${z}/${y}/${x}.png",
16 | "http://map2.daumcdn.net/map_usedistrict/1912uow/L${z}/${y}/${x}.png",
17 | "http://map3.daumcdn.net/map_usedistrict/1912uow/L${z}/${y}/${x}.png"
18 | ],
19 | resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
20 | attribution: ''
23 | + 'ⓒ Daum',
24 | sphericalMercator: false,
25 | buffer: 1,
26 | numZoomLevels: 14,
27 | minResolution: 0.25,
28 | maxResolution: 2048,
29 | units: "m",
30 | projection: new OpenLayers.Projection("EPSG:5181"),
31 | displayOutsideMaxExtent: true,
32 | maxExtent: new OpenLayers.Bounds(-30000, -60000, 494288, 988576),
33 | initialize: function(name, options) {
34 | if (!options) options = {resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25]};
35 | else if (!options.resolutions) options.resolutions = [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25];
36 | var newArgs = [name, null, options];
37 | OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs);
38 | },
39 | clone: function(obj) {
40 | if (obj == null) {
41 | obj = new OpenLayers.Layer.DaumCadstral(
42 | this.name, this.getOptions());
43 | }
44 | obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
45 | return obj;
46 | },
47 |
48 | getXYZ: function(bounds) {
49 | var res = this.getServerResolution();
50 | var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
51 | var y = Math.round((bounds.bottom - this.maxExtent.bottom) / (res * this.tileSize.h));
52 | var z = this.numZoomLevels - this.getServerZoom();
53 |
54 | if (this.wrapDateLine) {
55 | var limit = Math.pow(2, z);
56 | x = ((x % limit) + limit) % limit;
57 | }
58 |
59 | return {'x': x, 'y': y, 'z': z};
60 | },
61 |
62 | CLASS_NAME: "OpenLayers.Layer.DaumCadstral"
63 | });
64 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/OpenLayers.Layer.DaumPhysical.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
2 | * full list of contributors). Published under the 2-clause BSD license.
3 | * See license.txt in the OpenLayers distribution or repository for the
4 | * full text of the license. */
5 |
6 | /**
7 | * @requires OpenLayers/Layer/XYZ.js
8 | */
9 |
10 | OpenLayers.Layer.DaumPhysical = OpenLayers.Class(OpenLayers.Layer.XYZ, {
11 |
12 | name: "Daum Physical Map",
13 | url: [
14 | "http://map0.daumcdn.net/map_shaded_relief/3.00/L${z}/${y}/${x}.png",
15 | "http://map1.daumcdn.net/map_shaded_relief/3.00/L${z}/${y}/${x}.png",
16 | "http://map2.daumcdn.net/map_shaded_relief/3.00/L${z}/${y}/${x}.png",
17 | "http://map3.daumcdn.net/map_shaded_relief/3.00/L${z}/${y}/${x}.png"
18 | ],
19 | resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
20 | attribution: ''
23 | + 'ⓒ Daum',
24 | sphericalMercator: false,
25 | buffer: 1,
26 | numZoomLevels: 14,
27 | minResolution: 0.25,
28 | maxResolution: 2048,
29 | units: "m",
30 | projection: new OpenLayers.Projection("EPSG:5181"),
31 | displayOutsideMaxExtent: true,
32 | maxExtent: new OpenLayers.Bounds(-30000, -60000, 494288, 988576),
33 | initialize: function(name, options) {
34 | if (!options) options = {resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25]};
35 | else if (!options.resolutions) options.resolutions = [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25];
36 | var newArgs = [name, null, options];
37 | OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs);
38 | },
39 | clone: function(obj) {
40 | if (obj == null) {
41 | obj = new OpenLayers.Layer.DaumPhysical(
42 | this.name, this.getOptions());
43 | }
44 | obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
45 | return obj;
46 | },
47 |
48 | getXYZ: function(bounds) {
49 | var res = this.getServerResolution();
50 | var x = Math.round((bounds.left - this.maxExtent.left) /
51 | (res * this.tileSize.w));
52 | var y = Math.round((bounds.bottom - this.maxExtent.bottom) /
53 | (res * this.tileSize.h));
54 | var z = this.numZoomLevels - this.getServerZoom();
55 |
56 | if (this.wrapDateLine) {
57 | var limit = Math.pow(2, z);
58 | x = ((x % limit) + limit) % limit;
59 | }
60 |
61 | return {'x': x, 'y': y, 'z': z};
62 | },
63 |
64 | CLASS_NAME: "OpenLayers.Layer.DaumPhysical"
65 | });
66 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/OpenLayers.Layer.DaumSatellite.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
2 | * full list of contributors). Published under the 2-clause BSD license.
3 | * See license.txt in the OpenLayers distribution or repository for the
4 | * full text of the license. */
5 |
6 | /**
7 | * @requires OpenLayers/Layer/XYZ.js
8 | */
9 |
10 | OpenLayers.Layer.DaumSatellite = OpenLayers.Class(OpenLayers.Layer.XYZ, {
11 |
12 | name: "Daum Satellite Map",
13 | url: [
14 | "http://map0.daumcdn.net/map_skyview/L${z}/${y}/${x}.jpg?v=160107",
15 | "http://map1.daumcdn.net/map_skyview/L${z}/${y}/${x}.jpg?v=160107",
16 | "http://map2.daumcdn.net/map_skyview/L${z}/${y}/${x}.jpg?v=160107",
17 | "http://map3.daumcdn.net/map_skyview/L${z}/${y}/${x}.jpg?v=160107"
18 | ],
19 | resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
20 | attribution: ''
23 | + 'ⓒ Daum, Samah',
24 | sphericalMercator: false,
25 | transitionEffect: "resize",
26 | buffer: 1,
27 | numZoomLevels: 14,
28 | minResolution: 0.25,
29 | maxResolution: 2048,
30 | units: "m",
31 | projection: new OpenLayers.Projection("EPSG:5181"),
32 | displayOutsideMaxExtent: true,
33 | maxExtent: new OpenLayers.Bounds(-30000, -60000, 494288, 988576),
34 | initialize: function(name, options) {
35 | if (!options) options = {resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25]};
36 | else if (!options.resolutions) options.resolutions = [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25];
37 | var newArgs = [name, null, options];
38 | OpenLayers.Layer.XYZ.prototype.initialize.apply(this, newArgs);
39 | },
40 | clone: function(obj) {
41 | if (obj == null) {
42 | obj = new OpenLayers.Layer.DaumSatellite(
43 | this.name, this.getOptions());
44 | }
45 | obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
46 | return obj;
47 | },
48 |
49 | getXYZ: function(bounds) {
50 | var res = this.getServerResolution();
51 | var x = Math.round((bounds.left - this.maxExtent.left) /
52 | (res * this.tileSize.w));
53 | var y = Math.round((bounds.bottom - this.maxExtent.bottom) /
54 | (res * this.tileSize.h));
55 | var z = this.numZoomLevels - this.getServerZoom();
56 |
57 | if (this.wrapDateLine) {
58 | var limit = Math.pow(2, z);
59 | x = ((x % limit) + limit) % limit;
60 | }
61 |
62 | return {'x': x, 'y': y, 'z': z};
63 | },
64 |
65 | CLASS_NAME: "OpenLayers.Layer.DaumSatellite"
66 | });
67 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/vworld_gray.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers VWorldGray Layer
5 |
6 |
7 |
8 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/vworld_street.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers VWorldStreet Layer
5 |
6 |
7 |
8 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/tmsforkorea/plugin_upload.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # This script uploads a plugin package on the server
3 | #
4 | # Author: A. Pasotti, V. Picavet
5 |
6 | import xmlrpclib, sys, os
7 | import getpass
8 | from optparse import OptionParser
9 |
10 | # Configuration
11 | PROTOCOL='https'
12 | SERVER='plugins.qgis.org'
13 | PORT='443'
14 | ENDPOINT='/plugins/RPC2/'
15 | VERBOSE=False
16 |
17 | def main(options, args):
18 | address = "%s://%s:%s@%s:%s%s" % (PROTOCOL, options.username, options.password,
19 | options.server, options.port, ENDPOINT)
20 | print "Connecting to: %s" % hidepassword(address)
21 |
22 | server = xmlrpclib.ServerProxy(address, verbose=VERBOSE)
23 |
24 | try:
25 | plugin_id, version_id = server.plugin.upload(xmlrpclib.Binary(open(args[0]).read()))
26 | print "Plugin ID: %s" % plugin_id
27 | print "Version ID: %s" % version_id
28 | except xmlrpclib.ProtocolError, err:
29 | print "A protocol error occurred"
30 | print "URL: %s" % hidepassword(err.url, 0)
31 | print "HTTP/HTTPS headers: %s" % err.headers
32 | print "Error code: %d" % err.errcode
33 | print "Error message: %s" % err.errmsg
34 | except xmlrpclib.Fault, err:
35 | print "A fault occurred"
36 | print "Fault code: %d" % err.faultCode
37 | print "Fault string: %s" % err.faultString
38 |
39 | def hidepassword(url, start = 6):
40 | """Returns the http url with password part replaced with '*'."""
41 | passdeb = url.find(':', start) + 1
42 | passend = url.find('@')
43 | return "%s%s%s" % (url[:passdeb], '*' * (passend - passdeb), url[passend:])
44 |
45 |
46 | if __name__ == "__main__":
47 | parser = OptionParser(usage="%prog [options] plugin.zip")
48 | parser.add_option("-w", "--password", dest="password",
49 | help="Password for plugin site", metavar="******")
50 | parser.add_option("-u", "--username", dest="username",
51 | help="Username of plugin site", metavar="user")
52 | parser.add_option("-p", "--port", dest="port",
53 | help="Server port to connect to", metavar="80")
54 | parser.add_option("-s", "--server", dest="server",
55 | help="Specify server name", metavar="plugins.qgis.org")
56 | (options, args) = parser.parse_args()
57 | if len(args) != 1:
58 | print "Please specify zip file.\n"
59 | parser.print_help()
60 | sys.exit(1)
61 | if not options.server:
62 | options.server = SERVER
63 | if not options.port:
64 | options.port = PORT
65 | if not options.username:
66 | # interactive mode
67 | username = getpass.getuser()
68 | print "Please enter user name [%s] :"%username,
69 | res = raw_input()
70 | if res != "":
71 | options.username = res
72 | else:
73 | options.username = username
74 | if not options.password:
75 | # interactive mode
76 | options.password = getpass.getpass()
77 | main(options, args)
78 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/vworld_satellite.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers VWorldSatellite Layer
5 |
6 |
7 |
8 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/naver_cadastral.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Naver Cadstral Layer
5 |
6 |
7 |
8 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/naver_satellite.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Naver Satellite Layer
5 |
6 |
7 |
8 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/mango_maps.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | OpenLayers Plugin
5 | A QGIS plugin
6 |
7 | -------------------
8 | begin : 2018-11-23
9 | copyright : (C) 2009 by Minpa Lee, MangoSystem
10 | email : mapplus at gmail.com
11 | ***************************************************************************/
12 |
13 | /***************************************************************************
14 | * *
15 | * This program is free software; you can redistribute it and/or modify *
16 | * it under the terms of the GNU General Public License as published by *
17 | * the Free Software Foundation; either version 2 of the License, or *
18 | * (at your option) any later version. *
19 | * *
20 | ***************************************************************************/
21 | """
22 |
23 | from .weblayer import WebLayer3857
24 |
25 |
26 | class OlMangoMapsLayer(WebLayer3857):
27 |
28 | # Group in menu
29 | groupName = 'Mango Maps'
30 |
31 | # Group icon in menu
32 | groupIcon = 'mango_icon.png'
33 |
34 | # Supported EPSG projections, ordered by preference
35 | epsgList = [3857]
36 |
37 | # WGS84 bounds
38 | fullExtent = [124.41714675, 33.0022776231, 131.971482078, 38.6568782776]
39 |
40 | MIN_ZOOM_LEVEL = 6
41 |
42 | MAX_ZOOM_LEVEL = 17
43 |
44 | # QGIS scale for 72 dpi
45 | SCALE_ON_MAX_ZOOM = 13540
46 |
47 | emitsLoadEnd = False
48 |
49 | def __init__(self, name, html, xyzUrl, tilePixelRatio=0):
50 | WebLayer3857.__init__(self, groupName=self.groupName, groupIcon=self.groupIcon,
51 | name=name, html=html, xyzUrl=xyzUrl, tilePixelRatio=0) # Temporary
52 |
53 |
54 | class OlMangoBaseMapLayer(OlMangoMapsLayer):
55 |
56 | def __init__(self):
57 | tmsUrl = 'http://mango.iptime.org:8995/v.1.0.0/{z}/{x}/{y}.png?gray=false'
58 | OlMangoMapsLayer.__init__(self, name='Mango BaseMap', html='mango_base.html', xyzUrl=tmsUrl, tilePixelRatio=1)
59 |
60 |
61 | class OlMangoBaseMapGrayLayer(OlMangoMapsLayer):
62 |
63 | def __init__(self):
64 | tmsUrl = 'http://mango.iptime.org:8995/v.1.0.0/{z}/{x}/{y}.png?gray=true'
65 | OlMangoMapsLayer.__init__(self, name='Mango BaseMap Gray', html='mango_base_gray.html', xyzUrl=tmsUrl, tilePixelRatio=1)
66 |
67 |
68 | class OlMangoHiDPIMapLayer(OlMangoMapsLayer):
69 |
70 | def __init__(self):
71 | tmsUrl = 'http://mango.iptime.org:8996/v.1.0.0/{z}/{x}/{y}.png?gray=false'
72 | OlMangoMapsLayer.__init__(self, name='Mango BaseMap HiDPI', html='mango_hidpi.html', xyzUrl=tmsUrl, tilePixelRatio=2)
73 |
74 |
75 | class OlMangoHiDPIMapGrayLayer(OlMangoMapsLayer):
76 |
77 | def __init__(self):
78 | tmsUrl = 'http://mango.iptime.org:8996/v.1.0.0/{z}/{x}/{y}.png?gray=true'
79 | OlMangoMapsLayer.__init__(self, name='Mango BaseMap HiDPI Gray', html='mango_hidpi_gray.html', xyzUrl=tmsUrl, tilePixelRatio=2)
80 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/vworld_maps.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | OpenLayers Plugin
5 | A QGIS plugin
6 |
7 | -------------------
8 | begin : 2018-11-23
9 | copyright : (C) 2009 by Minpa Lee, MangoSystem
10 | email : mapplus at gmail.com
11 | ***************************************************************************/
12 |
13 | /***************************************************************************
14 | * *
15 | * This program is free software; you can redistribute it and/or modify *
16 | * it under the terms of the GNU General Public License as published by *
17 | * the Free Software Foundation; either version 2 of the License, or *
18 | * (at your option) any later version. *
19 | * *
20 | ***************************************************************************/
21 | """
22 |
23 | from .weblayer import WebLayer3857
24 |
25 |
26 | class OlVWorldMapsLayer(WebLayer3857):
27 |
28 | # Group in menu
29 | groupName = 'VWorld Maps'
30 |
31 | # Group icon in menu
32 | groupIcon = 'vworld_icon.png'
33 |
34 | # Supported EPSG projections, ordered by preference
35 | epsgList = [3857]
36 |
37 | # WGS84 bounds
38 | fullExtent = [124.41714675, 33.0022776231, 131.971482078, 38.6568782776]
39 |
40 | MIN_ZOOM_LEVEL = 7
41 |
42 | MAX_ZOOM_LEVEL = 18
43 |
44 | # QGIS scale for 72 dpi
45 | SCALE_ON_MAX_ZOOM = 13540
46 |
47 | emitsLoadEnd = False
48 |
49 | def __init__(self, name, html, xyzUrl, tilePixelRatio=0):
50 | WebLayer3857.__init__(self, groupName=self.groupName, groupIcon=self.groupIcon,
51 | name=name, html=html, xyzUrl=xyzUrl, tilePixelRatio=0) # Temporary
52 |
53 |
54 | class OlVWorldStreetLayer(OlVWorldMapsLayer):
55 |
56 | def __init__(self):
57 | tmsUrl = 'http://xdworld.vworld.kr:8080/2d/Base/service/{z}/{x}/{y}.png'
58 | OlVWorldMapsLayer.__init__(self, name='VWorld Street', html='vworld_street.html', xyzUrl=tmsUrl, tilePixelRatio=1)
59 |
60 |
61 | class OlVWorldHybridLayer(OlVWorldMapsLayer):
62 |
63 | def __init__(self):
64 | tmsUrl = ['http://xdworld.vworld.kr:8080/2d/Satellite/service/{z}/{x}/{y}.jpeg', 'http://xdworld.vworld.kr:8080/2d/Hybrid/service/{z}/{x}/{y}.png']
65 | OlVWorldMapsLayer.__init__(self, name='VWorld Hybrid', html='vworld_hybrid.html', xyzUrl=tmsUrl, tilePixelRatio=1)
66 |
67 |
68 | class OlVWorldSatelliteLayer(OlVWorldMapsLayer):
69 |
70 | def __init__(self):
71 | tmsUrl = 'http://xdworld.vworld.kr:8080/2d/Satellite/service/{z}/{x}/{y}.jpeg'
72 | OlVWorldMapsLayer.__init__(self, name='VWorld Satellite', html='vworld_satellite.html', xyzUrl=tmsUrl, tilePixelRatio=1)
73 |
74 |
75 | class OlVWorldGrayLayer(OlVWorldMapsLayer):
76 |
77 | def __init__(self):
78 | tmsUrl = 'http://xdworld.vworld.kr:8080/2d/gray/service/{z}/{x}/{y}.png'
79 | OlVWorldMapsLayer.__init__(self, name='VWorld Gray', html='vworld_gray.html', xyzUrl=tmsUrl, tilePixelRatio=1)
80 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/vworld_hybrid.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers VWorldHybrid Layer
5 |
6 |
7 |
8 |
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/ngii_white.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers NgiiStreet Layer
5 |
6 |
7 |
8 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/ngii_english.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers NgiiStreet Layer
5 |
6 |
7 |
8 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/ngii_street.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers NgiiStreet Layer
5 |
6 |
7 |
8 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/ngii_colorblind.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers NgiiStreet Layer
5 |
6 |
7 |
8 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/ngii_highdensity.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenLayers NgiiStreet Layer
5 |
6 |
7 |
8 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/naver_street.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Naver Street Layer
5 |
6 |
7 |
8 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/naver_hybrid.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Naver Hybrid Layer
5 |
6 |
7 |
8 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/html/naver_physical.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Naver Physical Layer
5 |
6 |
7 |
8 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/tmsforkorea/ui_openlayers_ovwidget.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Form implementation generated from reading ui file 'ui_openlayers_ovwidget.ui'
4 | #
5 | # Created by: PyQt5 UI code generator 5.9.1
6 | #
7 | # WARNING! All changes made in this file will be lost!
8 |
9 | from PyQt5 import QtCore, QtGui, QtWidgets
10 |
11 | class Ui_Form(object):
12 | def setupUi(self, Form):
13 | Form.setObjectName("Form")
14 | Form.resize(457, 467)
15 | self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form)
16 | self.verticalLayout_2.setObjectName("verticalLayout_2")
17 | self.lytEnableMap = QtWidgets.QHBoxLayout()
18 | self.lytEnableMap.setObjectName("lytEnableMap")
19 | self.checkBoxEnableMap = QtWidgets.QCheckBox(Form)
20 | self.checkBoxEnableMap.setChecked(False)
21 | self.checkBoxEnableMap.setObjectName("checkBoxEnableMap")
22 | self.lytEnableMap.addWidget(self.checkBoxEnableMap)
23 | self.comboBoxTypeMap = QtWidgets.QComboBox(Form)
24 | self.comboBoxTypeMap.setObjectName("comboBoxTypeMap")
25 | self.lytEnableMap.addWidget(self.comboBoxTypeMap)
26 | self.pbAddRaster = QtWidgets.QPushButton(Form)
27 | self.pbAddRaster.setText("")
28 | self.pbAddRaster.setObjectName("pbAddRaster")
29 | self.lytEnableMap.addWidget(self.pbAddRaster)
30 | spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
31 | self.lytEnableMap.addItem(spacerItem)
32 | self.verticalLayout_2.addLayout(self.lytEnableMap)
33 | self.lbStatusRead = QtWidgets.QLabel(Form)
34 | self.lbStatusRead.setText("")
35 | self.lbStatusRead.setTextFormat(QtCore.Qt.PlainText)
36 | self.lbStatusRead.setObjectName("lbStatusRead")
37 | self.verticalLayout_2.addWidget(self.lbStatusRead)
38 | self.webViewMap = QtWebKitWidgets.QWebView(Form)
39 | self.webViewMap.setObjectName("webViewMap")
40 | self.verticalLayout_2.addWidget(self.webViewMap)
41 | self.lytHideCross = QtWidgets.QHBoxLayout()
42 | self.lytHideCross.setObjectName("lytHideCross")
43 | self.checkBoxHideCross = QtWidgets.QCheckBox(Form)
44 | self.checkBoxHideCross.setObjectName("checkBoxHideCross")
45 | self.lytHideCross.addWidget(self.checkBoxHideCross)
46 | self.pbRefresh = QtWidgets.QPushButton(Form)
47 | self.pbRefresh.setText("")
48 | self.pbRefresh.setObjectName("pbRefresh")
49 | self.lytHideCross.addWidget(self.pbRefresh)
50 | self.pbSaveImg = QtWidgets.QPushButton(Form)
51 | self.pbSaveImg.setText("")
52 | self.pbSaveImg.setObjectName("pbSaveImg")
53 | self.lytHideCross.addWidget(self.pbSaveImg)
54 | self.pbCopyKml = QtWidgets.QPushButton(Form)
55 | self.pbCopyKml.setText("")
56 | self.pbCopyKml.setObjectName("pbCopyKml")
57 | self.lytHideCross.addWidget(self.pbCopyKml)
58 | spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
59 | self.lytHideCross.addItem(spacerItem1)
60 | self.verticalLayout_2.addLayout(self.lytHideCross)
61 |
62 | self.retranslateUi(Form)
63 | QtCore.QMetaObject.connectSlotsByName(Form)
64 |
65 | def retranslateUi(self, Form):
66 | _translate = QtCore.QCoreApplication.translate
67 | Form.setWindowTitle(_translate("Form", "Form"))
68 | self.checkBoxEnableMap.setText(_translate("Form", "Enable map"))
69 | self.pbAddRaster.setToolTip(_translate("Form", "Add map"))
70 | self.checkBoxHideCross.setText(_translate("Form", "Hide cross in map"))
71 | self.pbRefresh.setToolTip(_translate("Form", "Refresh map"))
72 | self.pbSaveImg.setToolTip(_translate("Form", "Save this image"))
73 | self.pbCopyKml.setToolTip(_translate("Form", "Copy rectangle (KML) of map to clipboard"))
74 |
75 | from PyQt5 import QtWebKitWidgets
76 |
--------------------------------------------------------------------------------
/tmsforkorea/ui_openlayers_ovwidget.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Form
4 |
5 |
6 |
7 | 0
8 | 0
9 | 457
10 | 467
11 |
12 |
13 |
14 | Form
15 |
16 |
17 | -
18 |
19 |
-
20 |
21 |
22 | Enable map
23 |
24 |
25 | false
26 |
27 |
28 |
29 | -
30 |
31 |
32 | -
33 |
34 |
35 | Add map
36 |
37 |
38 |
39 |
40 |
41 |
42 | -
43 |
44 |
45 | Qt::Horizontal
46 |
47 |
48 |
49 | 40
50 | 20
51 |
52 |
53 |
54 |
55 |
56 |
57 | -
58 |
59 |
60 |
61 |
62 |
63 | Qt::PlainText
64 |
65 |
66 |
67 | -
68 |
69 |
70 | -
71 |
72 |
-
73 |
74 |
75 | Hide cross in map
76 |
77 |
78 |
79 | -
80 |
81 |
82 | Refresh map
83 |
84 |
85 |
86 |
87 |
88 |
89 | -
90 |
91 |
92 | Save this image
93 |
94 |
95 |
96 |
97 |
98 |
99 | -
100 |
101 |
102 | Copy rectangle (KML) of map to clipboard
103 |
104 |
105 |
106 |
107 |
108 |
109 | -
110 |
111 |
112 | Qt::Horizontal
113 |
114 |
115 |
116 | 40
117 | 20
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 | QWebView
129 | QWidget
130 |
131 |
132 |
133 |
134 |
135 |
136 | activeCatalog()
137 |
138 |
139 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/naver_maps.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | OpenLayers Plugin
5 | A QGIS plugin
6 |
7 | -------------------
8 | begin : 2018-11-23
9 | copyright : (C) 2009 by Minpa Lee, MangoSystem
10 | email : mapplus at gmail.com
11 | ***************************************************************************/
12 |
13 | /***************************************************************************
14 | * *
15 | * This program is free software; you can redistribute it and/or modify *
16 | * it under the terms of the GNU General Public License as published by *
17 | * the Free Software Foundation; either version 2 of the License, or *
18 | * (at your option) any later version. *
19 | * *
20 | ***************************************************************************/
21 | """
22 |
23 | from qgis.core import (Qgis, QgsCoordinateReferenceSystem)
24 | from .weblayer import WebLayer3857
25 |
26 |
27 | class OlNaverMapsLayer(WebLayer3857):
28 |
29 | # Group in menu
30 | groupName = 'Naver Maps v5'
31 |
32 | # Group icon in menu
33 | groupIcon = 'naver_icon.png'
34 |
35 | # Supported EPSG projections, ordered by preference
36 | epsgList = [3857]
37 |
38 | # WGS84 bounds
39 | fullExtent = [124.41714675, 33.0022776231, 131.971482078, 38.6568782776]
40 |
41 | MIN_ZOOM_LEVEL = 6
42 |
43 | MAX_ZOOM_LEVEL = 17
44 |
45 | # QGIS scale for 72 dpi
46 | SCALE_ON_MAX_ZOOM = 13540
47 |
48 | emitsLoadEnd = False
49 |
50 | def __init__(self, name, html, xyzUrl, tilePixelRatio=2):
51 | WebLayer3857.__init__(self, groupName=self.groupName, groupIcon=self.groupIcon,
52 | name=name, html=html, xyzUrl=xyzUrl, tilePixelRatio=tilePixelRatio)
53 |
54 |
55 | class OlNaverStreetLayer(OlNaverMapsLayer):
56 |
57 | def __init__(self):
58 | tmsUrl = ["https://map.pstatic.net/nrb/styles/basic/1597915238/{z}/{x}/{y}@2x.png?mt=bg.ol.sw", \
59 | "https://map.pstatic.net/ozone/raster/7492ec55-c5c8-4005-be56-7d0b7c771b35/{z}/{x}/{y}?mapType=NORMAL%26pixelRatio=2%26language=ko%26layers=TRANSIT,POI"]
60 | OlNaverMapsLayer.__init__(self, name="Naver Street", html="naver_street.html", xyzUrl=tmsUrl)
61 |
62 |
63 | class OlNaverHybridLayer(OlNaverMapsLayer):
64 |
65 | def __init__(self):
66 | tmsUrl = ["https://map.pstatic.net/nrb/styles/satellite/1597915238/{z}/{x}/{y}@2x.png?mt=bg.ol.sw", \
67 | "https://map.pstatic.net/ozone/raster/7492ec55-c5c8-4005-be56-7d0b7c771b35/{z}/{x}/{y}?mapType=HYBRID%26pixelRatio=2%26language=ko%26layers=TRANSIT,POI"]
68 | OlNaverMapsLayer.__init__(self, name="Naver Hybrid", html="naver_hybrid.html", xyzUrl=tmsUrl)
69 |
70 |
71 | class OlNaverSatelliteLayer(OlNaverMapsLayer):
72 |
73 | def __init__(self):
74 | tmsUrl = "https://map.pstatic.net/nrb/styles/satellite/1597915238/{z}/{x}/{y}@2x.png?mt=bg.ol.sw"
75 | OlNaverMapsLayer.__init__(self, name="Naver Satellite", html="naver_satellite.html", xyzUrl=tmsUrl)
76 |
77 |
78 | class OlNaverPhysicalLayer(OlNaverMapsLayer):
79 |
80 | def __init__(self):
81 | tmsUrl = ["https://map.pstatic.net/nrb/styles/terrain/1597915238/{z}/{x}/{y}@2x.png?mt=bg.ol.sw", \
82 | "https://map.pstatic.net/ozone/raster/7492ec55-c5c8-4005-be56-7d0b7c771b35/{z}/{x}/{y}?mapType=TERRAIN%26pixelRatio=2%26language=ko%26layers=TRANSIT,POI"]
83 | OlNaverMapsLayer.__init__(self, name="Naver Physical", html="naver_physical.html", xyzUrl=tmsUrl)
84 |
85 |
86 | class OlNaverCadastralLayer(OlNaverMapsLayer):
87 |
88 | def __init__(self):
89 | tmsUrl = "https://map.pstatic.net/nrb/styles/basic/1597915238/{z}/{x}/{y}@2x.png?mt=bg.ol.sw.lp"
90 | OlNaverMapsLayer.__init__(self, name="Naver Cadastral", html="naver_cadastral.html", xyzUrl=tmsUrl)
91 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/daum_maps.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | OpenLayers Plugin
5 | A QGIS plugin
6 |
7 | -------------------
8 | begin : 2018-11-23
9 | copyright : (C) 2009 by Minpa Lee, MangoSystem
10 | email : mapplus at gmail.com
11 | ***************************************************************************/
12 |
13 | /***************************************************************************
14 | * *
15 | * This program is free software; you can redistribute it and/or modify *
16 | * it under the terms of the GNU General Public License as published by *
17 | * the Free Software Foundation; either version 2 of the License, or *
18 | * (at your option) any later version. *
19 | * *
20 | ***************************************************************************/
21 | """
22 |
23 | from qgis.core import (Qgis, QgsCoordinateReferenceSystem)
24 | from .weblayer import WebLayer
25 |
26 |
27 | class WebLayerDaum5181(WebLayer):
28 |
29 | # QGIS scale for 72 dpi
30 | SCALE_ON_MAX_ZOOM = 13540
31 |
32 | emitsLoadEnd = False
33 |
34 | def __init__(self, groupName, groupIcon, name, html, xyzUrl=None):
35 | WebLayer.__init__(self, groupName=groupName, groupIcon=groupIcon,
36 | name=name, html=html, xyzUrl=xyzUrl)
37 |
38 | def coordRefSys(self, mapCoordSys):
39 | epsg = self.epsgList[0]
40 | coordRefSys = QgsCoordinateReferenceSystem()
41 | if Qgis.QGIS_VERSION_INT >= 10900:
42 | idEpsgRSGoogle = "EPSG:%d" % epsg
43 | createCrs = coordRefSys.createFromOgcWmsCrs(idEpsgRSGoogle)
44 | else:
45 | idEpsgRSGoogle = epsg
46 | createCrs = coordRefSys.createFromEpsg(idEpsgRSGoogle)
47 | if not createCrs:
48 | proj_def = "+proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=500000 +ellps=GRS80 "
49 | proj_def += "+towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
50 | isOk = coordRefSys.createFromProj4(proj_def)
51 | if not isOk:
52 | return None
53 | return coordRefSys
54 |
55 |
56 | class OlDaumMapsLayer(WebLayerDaum5181):
57 |
58 | # Group in menu
59 | groupName = 'Kakao Maps'
60 |
61 | # Group icon in menu
62 | groupIcon = 'daum_icon.png'
63 |
64 | # Supported EPSG projections, ordered by preference
65 | epsgList = [5181]
66 |
67 | # EPSG 5181 bounds
68 | fullExtent = [-30000, -60000, 494288, 988576]
69 |
70 | MIN_ZOOM_LEVEL = 0
71 |
72 | MAX_ZOOM_LEVEL = 14
73 |
74 | def __init__(self, name, html, xyzUrl=None):
75 | WebLayerDaum5181.__init__(self, groupName=self.groupName, groupIcon=self.groupIcon,
76 | name=name, html=html, xyzUrl=xyzUrl)
77 |
78 |
79 | class OlDaumStreetLayer(OlDaumMapsLayer):
80 |
81 | def __init__(self):
82 | OlDaumMapsLayer.__init__(self, name='Kakao Street', html='daum_street.html', xyzUrl=None)
83 |
84 |
85 | class OlDaumHybridLayer(OlDaumMapsLayer):
86 |
87 | def __init__(self):
88 | OlDaumMapsLayer.__init__(self, name='Kakao Hybrid', html='daum_hybrid.html', xyzUrl=None)
89 |
90 |
91 | class OlDaumSatelliteLayer(OlDaumMapsLayer):
92 |
93 | def __init__(self):
94 | OlDaumMapsLayer.__init__(self, name='Kakao Satellite', html='daum_satellite.html', xyzUrl=None)
95 |
96 |
97 | class OlDaumPhysicalLayer(OlDaumMapsLayer):
98 |
99 | def __init__(self):
100 | OlDaumMapsLayer.__init__(self, name='Kakao Physical', html='daum_physical.html', xyzUrl=None)
101 |
102 |
103 | class OlDaumCadstralLayer(OlDaumMapsLayer):
104 |
105 | def __init__(self):
106 | OlDaumMapsLayer.__init__(self, name='Kakao Cadstral', html='daum_cadastral.html', xyzUrl=None)
107 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/ngii_maps.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | OpenLayers Plugin
5 | A QGIS plugin
6 |
7 | -------------------
8 | begin : 2018-11-23
9 | copyright : (C) 2009 by Minpa Lee, MangoSystem
10 | email : mapplus at gmail.com
11 | ***************************************************************************/
12 |
13 | /***************************************************************************
14 | * *
15 | * This program is free software; you can redistribute it and/or modify *
16 | * it under the terms of the GNU General Public License as published by *
17 | * the Free Software Foundation; either version 2 of the License, or *
18 | * (at your option) any later version. *
19 | * *
20 | ***************************************************************************/
21 | """
22 |
23 | from qgis.core import (Qgis, QgsCoordinateReferenceSystem)
24 | from .weblayer import WebLayer
25 |
26 |
27 | class WebLayerNgii5179(WebLayer):
28 |
29 | # QGIS scale for 72 dpi
30 | SCALE_ON_MAX_ZOOM = 13540
31 |
32 | emitsLoadEnd = False
33 |
34 | def __init__(self, groupName, groupIcon, name, html, xyzUrl=None):
35 | WebLayer.__init__(self, groupName=groupName, groupIcon=groupIcon,
36 | name=name, html=html, xyzUrl=xyzUrl)
37 |
38 | def coordRefSys(self, mapCoordSys):
39 | epsg = self.epsgList[0]
40 | coordRefSys = QgsCoordinateReferenceSystem()
41 | if Qgis.QGIS_VERSION_INT >= 10900:
42 | idEpsgRSGoogle = "EPSG:%d" % epsg
43 | createCrs = coordRefSys.createFromOgcWmsCrs(idEpsgRSGoogle)
44 | else:
45 | idEpsgRSGoogle = epsg
46 | createCrs = coordRefSys.createFromEpsg(idEpsgRSGoogle)
47 | if not createCrs:
48 | proj_def = "+proj=tmerc +lat_0=38 +lon_0=127.5 +k=0.9996 +x_0=1000000 +y_0=2000000 +ellps=GRS80 "
49 | proj_def += "+towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
50 | isOk = coordRefSys.createFromProj4(proj_def)
51 | if not isOk:
52 | return None
53 | return coordRefSys
54 |
55 |
56 | class OlNgiiMapsLayer(WebLayerNgii5179):
57 |
58 | # Group in menu
59 | groupName = 'NGII Maps'
60 |
61 | # Group icon in menu
62 | groupIcon = 'ngii_icon.png'
63 |
64 | # Supported EPSG projections, ordered by preference
65 | epsgList = [5179]
66 |
67 | # EPSG 5179 bounds
68 | fullExtent = [-200000.0, 1139355.62 , 2140685, 2970242]
69 |
70 | MIN_ZOOM_LEVEL = 0
71 |
72 | MAX_ZOOM_LEVEL = 14
73 |
74 | def __init__(self, name, html, xyzUrl=None):
75 | WebLayerNgii5179.__init__(self, groupName=self.groupName, groupIcon=self.groupIcon,
76 | name=name, html=html, xyzUrl=xyzUrl)
77 |
78 |
79 | class OlNgiiStreetLayer(OlNgiiMapsLayer):
80 |
81 | def __init__(self):
82 | OlNgiiMapsLayer.__init__(self, name='NGII Street', html='ngii_street.html', xyzUrl=None)
83 |
84 |
85 | class OlNgiiBlankLayer(OlNgiiMapsLayer):
86 |
87 | def __init__(self):
88 | OlNgiiMapsLayer.__init__(self, name='NGII White', html='ngii_white.html', xyzUrl=None)
89 |
90 |
91 | class OlNgiiEnglishLayer(OlNgiiMapsLayer):
92 |
93 | def __init__(self):
94 | OlNgiiMapsLayer.__init__(self, name='NGII English', html='ngii_english.html', xyzUrl=None)
95 |
96 |
97 | class OlNgiiHighDensityLayer(OlNgiiMapsLayer):
98 |
99 | def __init__(self):
100 | OlNgiiMapsLayer.__init__(self, name='NGII High-Density', html='ngii_highdensity.html', xyzUrl=None)
101 |
102 |
103 | class OlNgiiColorBlindLayer(OlNgiiMapsLayer):
104 |
105 | def __init__(self):
106 | OlNgiiMapsLayer.__init__(self, name='NGII Color-Blind', html='ngii_colorblind.html', xyzUrl=None)
107 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/naver_maps_old.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | OpenLayers Plugin
5 | A QGIS plugin
6 |
7 | -------------------
8 | begin : 2018-11-23
9 | copyright : (C) 2009 by Minpa Lee, MangoSystem
10 | email : mapplus at gmail.com
11 | ***************************************************************************/
12 |
13 | /***************************************************************************
14 | * *
15 | * This program is free software; you can redistribute it and/or modify *
16 | * it under the terms of the GNU General Public License as published by *
17 | * the Free Software Foundation; either version 2 of the License, or *
18 | * (at your option) any later version. *
19 | * *
20 | ***************************************************************************/
21 | """
22 |
23 | from qgis.core import (Qgis, QgsCoordinateReferenceSystem)
24 | from .weblayer import WebLayer
25 |
26 |
27 | class WebLayerNaver5179(WebLayer):
28 |
29 | # QGIS scale for 72 dpi
30 | SCALE_ON_MAX_ZOOM = 13540
31 |
32 | emitsLoadEnd = False
33 |
34 | def __init__(self, groupName, groupIcon, name, html, xyzUrl=None):
35 | WebLayer.__init__(self, groupName=groupName, groupIcon=groupIcon,
36 | name=name, html=html, xyzUrl=xyzUrl)
37 |
38 | def coordRefSys(self, mapCoordSys):
39 | epsg = self.epsgList[0]
40 | coordRefSys = QgsCoordinateReferenceSystem()
41 | if Qgis.QGIS_VERSION_INT >= 10900:
42 | idEpsgRSGoogle = "EPSG:%d" % epsg
43 | createCrs = coordRefSys.createFromOgcWmsCrs(idEpsgRSGoogle)
44 | else:
45 | idEpsgRSGoogle = epsg
46 | createCrs = coordRefSys.createFromEpsg(idEpsgRSGoogle)
47 | if not createCrs:
48 | proj_def = "+proj=tmerc +lat_0=38 +lon_0=127.5 +k=0.9996 +x_0=1000000 +y_0=2000000 +ellps=GRS80 "
49 | proj_def += "+towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
50 | isOk = coordRefSys.createFromProj4(proj_def)
51 | if not isOk:
52 | return None
53 | return coordRefSys
54 |
55 |
56 | class OlNaverMaps5179Layer(WebLayerNaver5179):
57 |
58 | # Group in menu
59 | groupName = 'Naver Maps v3'
60 |
61 | # Group icon in menu
62 | groupIcon = 'naver_icon.png'
63 |
64 | # Supported EPSG projections, ordered by preference
65 | epsgList = [5179]
66 |
67 | # EPSG 5179 bounds
68 | fullExtent = [90112, 1192896, 1990673, 2761664]
69 |
70 | MIN_ZOOM_LEVEL = 0
71 |
72 | MAX_ZOOM_LEVEL = 14
73 |
74 | def __init__(self, name, html, xyzUrl=None):
75 | WebLayerNaver5179.__init__(self, groupName=self.groupName, groupIcon=self.groupIcon,
76 | name=name, html=html, xyzUrl=xyzUrl)
77 |
78 |
79 | class OlNaverStreet5179Layer(OlNaverMaps5179Layer):
80 |
81 | def __init__(self):
82 | OlNaverMaps5179Layer.__init__(self, name='Naver Street - 5179', html='naver_street_5179.html', xyzUrl=None)
83 |
84 |
85 | class OlNaverHybrid5179Layer(OlNaverMaps5179Layer):
86 |
87 | def __init__(self):
88 | OlNaverMaps5179Layer.__init__(self, name='Naver Hybrid - 5179', html='naver_hybrid_5179.html', xyzUrl=None)
89 |
90 |
91 | class OlNaverSatellite5179Layer(OlNaverMaps5179Layer):
92 |
93 | def __init__(self):
94 | OlNaverMaps5179Layer.__init__(self, name='Naver Satellite - 5179', html='naver_satellite_5179.html', xyzUrl=None)
95 |
96 |
97 | class OlNaverPhysical5179Layer(OlNaverMaps5179Layer):
98 |
99 | def __init__(self):
100 | OlNaverMaps5179Layer.__init__(self, name='Naver Physical - 5179', html='naver_physical_5179.html', xyzUrl=None)
101 |
102 |
103 | class OlNaverCadastral5179Layer(OlNaverMaps5179Layer):
104 |
105 | def __init__(self):
106 | OlNaverMaps5179Layer.__init__(self, name='Naver Cadastral - 5179', html='naver_cadastral_5179.html', xyzUrl=None)
107 |
--------------------------------------------------------------------------------
/tmsforkorea/Makefile:
--------------------------------------------------------------------------------
1 | #/***************************************************************************
2 | # OpenlayersPlugin
3 | #
4 | # OpenStreetMap, Google Maps, Bing Maps layers and more
5 | # -------------------
6 | # begin : 2014-03-24
7 | # copyright : (C) 2014 by Sourcepole and contributors
8 | # email : pka@sourcepole.ch
9 | # ***************************************************************************/
10 | #
11 | #/***************************************************************************
12 | # * *
13 | # * This program is free software; you can redistribute it and/or modify *
14 | # * it under the terms of the GNU General Public License as published by *
15 | # * the Free Software Foundation; either version 2 of the License, or *
16 | # * (at your option) any later version. *
17 | # * *
18 | # ***************************************************************************/
19 |
20 | # CONFIGURATION
21 | PLUGIN_UPLOAD = $(CURDIR)/plugin_upload.py
22 |
23 | QGISDIR=.qgis2
24 |
25 | # Makefile for a PyQGIS plugin
26 |
27 | # translation
28 | SOURCES = openlayers_plugin.py \
29 | ui_about_dialog.py \
30 | openlayers_ovwidget.py \
31 | ui_openlayers_ovwidget.py
32 |
33 | TRANSLATIONS = i18n/openlayers_de.ts \
34 | i18n/openlayers_en.ts \
35 | i18n/openlayers_fr.ts \
36 | i18n/openlayers_pt_BR.ts \
37 | i18n/openlayers_es.ts
38 |
39 | # global
40 |
41 | PLUGINNAME = openlayers_plugin
42 |
43 | PY_FILES = __init__.py
44 |
45 | EXTRAS = openlayers.png
46 |
47 | UI_FILES = ui_about_dialog.py ui_openlayers_ovwidget.py
48 |
49 | RESOURCE_FILES = resources_rc.py
50 |
51 | HELP = help/build/html
52 |
53 | default: compile
54 |
55 | compile: $(UI_FILES) $(RESOURCE_FILES)
56 |
57 | %_rc.py : %.qrc
58 | pyrcc4 -o $*_rc.py $<
59 |
60 | %.py : %.ui
61 | pyuic4 -o $@ $<
62 |
63 | %.qm : %.ts
64 | /usr/lib/x86_64-linux-gnu/qt4/bin/lrelease $<
65 |
66 | # The deploy target only works on unix like operating system where
67 | # the Python plugin directory is located at:
68 | # $HOME/$(QGISDIR)/python/plugins
69 | deploy: compile doc transcompile
70 | mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
71 | cp -vf $(PY_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
72 | cp -vf $(UI_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
73 | cp -vf $(RESOURCE_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
74 | cp -vf $(EXTRAS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
75 | cp -vfr i18n $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
76 | cp -vfr $(HELP) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/help
77 |
78 | # The dclean target removes compiled python files from plugin directory
79 | # also delets any .svn entry
80 | dclean:
81 | find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete
82 | find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname ".svn" -prune -exec rm -Rf {} \;
83 |
84 | # The derase deletes deployed plugin
85 | derase:
86 | rm -Rf $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
87 |
88 | # The zip target deploys the plugin and creates a zip file with the deployed
89 | # content. You can then upload the zip file on http://plugins.qgis.org
90 | zip: deploy dclean
91 | rm -f $(PLUGINNAME).zip
92 | cd $(HOME)/$(QGISDIR)/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)
93 |
94 | # Create a zip package of the plugin named $(PLUGINNAME).zip.
95 | # This requires use of git (your plugin development directory must be a
96 | # git repository).
97 | # To use, pass a valid commit or tag as follows:
98 | # make package VERSION=Version_0.3.2
99 | package: compile
100 | rm -f $(PLUGINNAME).zip
101 | git archive --prefix=$(PLUGINNAME)/ -o $(PLUGINNAME).zip $(VERSION)
102 | echo "Created package: $(PLUGINNAME).zip"
103 |
104 | upload: #zip
105 | $(PLUGIN_UPLOAD) $(PLUGINNAME).zip
106 |
107 | # transup
108 | # update .ts translation files
109 | transup:
110 | pylupdate4 Makefile
111 |
112 | # transcompile
113 | # compile translation files into .qm binary format
114 | transcompile: $(TRANSLATIONS:.ts=.qm)
115 |
116 | # transclean
117 | # deletes all .qm files
118 | transclean:
119 | rm -f i18n/*.qm
120 |
121 | clean:
122 | rm $(UI_FILES) $(RESOURCE_FILES)
123 |
124 | # build documentation with sphinx
125 | doc:
126 | cd help; make html
127 |
128 | # To plugins.qgis.org:
129 | # make package VERSION=master
130 | # make upload
131 |
--------------------------------------------------------------------------------
/tmsforkorea/help/make.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | REM Command file for Sphinx documentation
4 |
5 | if "%SPHINXBUILD%" == "" (
6 | set SPHINXBUILD=sphinx-build
7 | )
8 | set BUILDDIR=build
9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
10 | if NOT "%PAPER%" == "" (
11 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
12 | )
13 |
14 | if "%1" == "" goto help
15 |
16 | if "%1" == "help" (
17 | :help
18 | echo.Please use `make ^` where ^ is one of
19 | echo. html to make standalone HTML files
20 | echo. dirhtml to make HTML files named index.html in directories
21 | echo. singlehtml to make a single large HTML file
22 | echo. pickle to make pickle files
23 | echo. json to make JSON files
24 | echo. htmlhelp to make HTML files and a HTML help project
25 | echo. qthelp to make HTML files and a qthelp project
26 | echo. devhelp to make HTML files and a Devhelp project
27 | echo. epub to make an epub
28 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
29 | echo. text to make text files
30 | echo. man to make manual pages
31 | echo. changes to make an overview over all changed/added/deprecated items
32 | echo. linkcheck to check all external links for integrity
33 | echo. doctest to run all doctests embedded in the documentation if enabled
34 | goto end
35 | )
36 |
37 | if "%1" == "clean" (
38 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
39 | del /q /s %BUILDDIR%\*
40 | goto end
41 | )
42 |
43 | if "%1" == "html" (
44 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
45 | echo.
46 | echo.Build finished. The HTML pages are in %BUILDDIR%/html.
47 | goto end
48 | )
49 |
50 | if "%1" == "dirhtml" (
51 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
52 | echo.
53 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
54 | goto end
55 | )
56 |
57 | if "%1" == "singlehtml" (
58 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
59 | echo.
60 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
61 | goto end
62 | )
63 |
64 | if "%1" == "pickle" (
65 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
66 | echo.
67 | echo.Build finished; now you can process the pickle files.
68 | goto end
69 | )
70 |
71 | if "%1" == "json" (
72 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
73 | echo.
74 | echo.Build finished; now you can process the JSON files.
75 | goto end
76 | )
77 |
78 | if "%1" == "htmlhelp" (
79 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
80 | echo.
81 | echo.Build finished; now you can run HTML Help Workshop with the ^
82 | .hhp project file in %BUILDDIR%/htmlhelp.
83 | goto end
84 | )
85 |
86 | if "%1" == "qthelp" (
87 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
88 | echo.
89 | echo.Build finished; now you can run "qcollectiongenerator" with the ^
90 | .qhcp project file in %BUILDDIR%/qthelp, like this:
91 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\templateclass.qhcp
92 | echo.To view the help file:
93 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\templateclass.ghc
94 | goto end
95 | )
96 |
97 | if "%1" == "devhelp" (
98 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
99 | echo.
100 | echo.Build finished.
101 | goto end
102 | )
103 |
104 | if "%1" == "epub" (
105 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
106 | echo.
107 | echo.Build finished. The epub file is in %BUILDDIR%/epub.
108 | goto end
109 | )
110 |
111 | if "%1" == "latex" (
112 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
113 | echo.
114 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
115 | goto end
116 | )
117 |
118 | if "%1" == "text" (
119 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
120 | echo.
121 | echo.Build finished. The text files are in %BUILDDIR%/text.
122 | goto end
123 | )
124 |
125 | if "%1" == "man" (
126 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
127 | echo.
128 | echo.Build finished. The manual pages are in %BUILDDIR%/man.
129 | goto end
130 | )
131 |
132 | if "%1" == "changes" (
133 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
134 | echo.
135 | echo.The overview file is in %BUILDDIR%/changes.
136 | goto end
137 | )
138 |
139 | if "%1" == "linkcheck" (
140 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
141 | echo.
142 | echo.Link check complete; look for any errors in the above output ^
143 | or in %BUILDDIR%/linkcheck/output.txt.
144 | goto end
145 | )
146 |
147 | if "%1" == "doctest" (
148 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
149 | echo.
150 | echo.Testing of doctests in the sources finished, look at the ^
151 | results in %BUILDDIR%/doctest/output.txt.
152 | goto end
153 | )
154 |
155 | :end
156 |
--------------------------------------------------------------------------------
/tmsforkorea/help/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line.
5 | SPHINXOPTS =
6 | SPHINXBUILD = sphinx-build
7 | PAPER =
8 | BUILDDIR = build
9 |
10 | # Internal variables.
11 | PAPEROPT_a4 = -D latex_paper_size=a4
12 | PAPEROPT_letter = -D latex_paper_size=letter
13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
14 |
15 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
16 |
17 | help:
18 | @echo "Please use \`make ' where is one of"
19 | @echo " html to make standalone HTML files"
20 | @echo " dirhtml to make HTML files named index.html in directories"
21 | @echo " singlehtml to make a single large HTML file"
22 | @echo " pickle to make pickle files"
23 | @echo " json to make JSON files"
24 | @echo " htmlhelp to make HTML files and a HTML help project"
25 | @echo " qthelp to make HTML files and a qthelp project"
26 | @echo " devhelp to make HTML files and a Devhelp project"
27 | @echo " epub to make an epub"
28 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
29 | @echo " latexpdf to make LaTeX files and run them through pdflatex"
30 | @echo " text to make text files"
31 | @echo " man to make manual pages"
32 | @echo " changes to make an overview of all changed/added/deprecated items"
33 | @echo " linkcheck to check all external links for integrity"
34 | @echo " doctest to run all doctests embedded in the documentation (if enabled)"
35 |
36 | clean:
37 | -rm -rf $(BUILDDIR)/*
38 |
39 | html:
40 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
41 | @echo
42 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
43 |
44 | dirhtml:
45 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
46 | @echo
47 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
48 |
49 | singlehtml:
50 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
51 | @echo
52 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
53 |
54 | pickle:
55 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
56 | @echo
57 | @echo "Build finished; now you can process the pickle files."
58 |
59 | json:
60 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
61 | @echo
62 | @echo "Build finished; now you can process the JSON files."
63 |
64 | htmlhelp:
65 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
66 | @echo
67 | @echo "Build finished; now you can run HTML Help Workshop with the" \
68 | ".hhp project file in $(BUILDDIR)/htmlhelp."
69 |
70 | qthelp:
71 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
72 | @echo
73 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \
74 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
75 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/templateclass.qhcp"
76 | @echo "To view the help file:"
77 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/templateclass.qhc"
78 |
79 | devhelp:
80 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
81 | @echo
82 | @echo "Build finished."
83 | @echo "To view the help file:"
84 | @echo "# mkdir -p $$HOME/.local/share/devhelp/templateclass"
85 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/templateclass"
86 | @echo "# devhelp"
87 |
88 | epub:
89 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
90 | @echo
91 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
92 |
93 | latex:
94 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
95 | @echo
96 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
97 | @echo "Run \`make' in that directory to run these through (pdf)latex" \
98 | "(use \`make latexpdf' here to do that automatically)."
99 |
100 | latexpdf:
101 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
102 | @echo "Running LaTeX files through pdflatex..."
103 | make -C $(BUILDDIR)/latex all-pdf
104 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
105 |
106 | text:
107 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
108 | @echo
109 | @echo "Build finished. The text files are in $(BUILDDIR)/text."
110 |
111 | man:
112 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
113 | @echo
114 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
115 |
116 | changes:
117 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
118 | @echo
119 | @echo "The overview file is in $(BUILDDIR)/changes."
120 |
121 | linkcheck:
122 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
123 | @echo
124 | @echo "Link check complete; look for any errors in the above output " \
125 | "or in $(BUILDDIR)/linkcheck/output.txt."
126 |
127 | doctest:
128 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
129 | @echo "Testing of doctests in the sources finished, look at the " \
130 | "results in $(BUILDDIR)/doctest/output.txt."
131 |
--------------------------------------------------------------------------------
/tmsforkorea/weblayers/weblayer.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | OpenLayers Plugin
5 | A QGIS plugin
6 |
7 | -------------------
8 | begin : 2009-11-30
9 | copyright : (C) 2009 by Pirmin Kalberer, Sourcepole
10 | email : pka at sourcepole.ch
11 | ***************************************************************************/
12 |
13 | /***************************************************************************
14 | * *
15 | * This program is free software; you can redistribute it and/or modify *
16 | * it under the terms of the GNU General Public License as published by *
17 | * the Free Software Foundation; either version 2 of the License, or *
18 | * (at your option) any later version. *
19 | * *
20 | ***************************************************************************/
21 | """
22 |
23 | from qgis.PyQt.QtGui import QIcon
24 | from qgis.PyQt.QtWidgets import QAction, QMenu
25 | from qgis.core import Qgis as QGis, QgsCoordinateReferenceSystem
26 | import os
27 |
28 |
29 | class WebLayerGroup:
30 | """Group in menu"""
31 |
32 | def __init__(self, name, icon):
33 | self._menu = QMenu(name)
34 | self._menu.setIcon(QIcon(os.path.join(
35 | ":/plugins/tmsforkorea/weblayers/icons", icon)))
36 |
37 | def menu(self):
38 | return self._menu
39 |
40 |
41 | class WebLayer:
42 | """Base class for OpenLayers layers"""
43 |
44 | displayName = None
45 | """Layer type name in menu"""
46 |
47 | layerTypeName = None
48 | """Layer type identificator used to store in project"""
49 |
50 | layerTypeId = None
51 | """Numerical ID used in versions < 2.3"""
52 | # GOOGLE_TERRAIN => 0,
53 | # GOOGLE_ROADMAP => 1,
54 | # GOOGLE_HYBRID => 2,
55 | # GOOGLE_SATELLITE => 3,
56 | # OSM => 4,
57 | # OCM => 5,
58 | # OCM_LANDSCAPE => 6,
59 | # OCM_PUBLIC_TRANSPORT => 7,
60 | # YAHOO_STREET => 8,
61 | # YAHOO_HYBRID => 9,
62 | # YAHOO_SATELLITE => 10,
63 | # BING_ROAD => 11,
64 | # BING_AERIAL => 12,
65 | # BING_AERIAL_WITH_LABELS => 13,
66 | # APPLE_IPHOTO => 14
67 |
68 | groupName = None
69 | """Group in menu"""
70 |
71 | groupIcon = None
72 | """Group icon in menu"""
73 |
74 | epsgList = []
75 | """Supported EPSG projections, ordered by preference"""
76 |
77 | fullExtent = [-180.0, -90.0, 180.0, 90.0]
78 | """WGS84 bounds"""
79 |
80 | tilePixelRatio = 1
81 | """Tile Resolution : 1 = 256, 2 = 512(HiDPI) """
82 |
83 | emitsLoadEnd = True
84 |
85 | def __init__(self, groupName, groupIcon, name, html, xyzUrl=None, tilePixelRatio=1):
86 | self.groupName = groupName
87 | self.groupIcon = groupIcon
88 | self.displayName = name
89 | self.layerTypeName = name
90 | self._html = html
91 | # optional GDAL TMS config to use as layer instead of an
92 | # OpenlayersLayer
93 | # the OpenlayersLayer is still used in the OpenLayers Overview
94 | self._xyzUrl = xyzUrl
95 | self.tilePixelRatio = tilePixelRatio
96 |
97 | def addMenuEntry(self, groupMenu, parent):
98 | self._actionAddLayer = QAction(self.displayName, parent)
99 | self._actionAddLayer.triggered.connect(self.addLayer)
100 | groupMenu.addAction(self._actionAddLayer)
101 |
102 | def setAddLayerCallback(self, addLayerCallback):
103 | self._addLayerCallback = addLayerCallback
104 |
105 | def addLayer(self):
106 | self._addLayerCallback(self)
107 |
108 | def html_url(self):
109 | dir = os.path.dirname(__file__)
110 | url = "file:///%s/html/%s" % (dir.replace("\\", "/"), self._html)
111 | return url
112 |
113 | def hasXYZUrl(self):
114 | return self._xyzUrl is not None
115 |
116 | def xyzUrlConfig(self):
117 | if self._xyzUrl is not None:
118 | return self._xyzUrl
119 | else:
120 | return None
121 |
122 | def coordRefSys(self, mapCoordSys):
123 | epsg = self.epsgList[0] # TODO: look for matching coord
124 | coordRefSys = QgsCoordinateReferenceSystem()
125 | createCrs = coordRefSys.createFromOgcWmsCrs("EPSG:%d" % epsg)
126 | if not createCrs:
127 | return None
128 | return coordRefSys
129 |
130 |
131 | class WebLayer3857(WebLayer):
132 |
133 | epsgList = [3857]
134 |
135 | MAX_ZOOM_LEVEL = 15
136 | SCALE_ON_MAX_ZOOM = 13540 # QGIS scale for 72 dpi
137 |
138 | def coordRefSys(self, mapCoordSys):
139 | epsg = self.epsgList[0]
140 | coordRefSys = QgsCoordinateReferenceSystem()
141 | if QGis.QGIS_VERSION_INT >= 10900:
142 | idEpsgRSGoogle = "EPSG:%d" % epsg
143 | createCrs = coordRefSys.createFromOgcWmsCrs(idEpsgRSGoogle)
144 | else:
145 | idEpsgRSGoogle = epsg
146 | createCrs = coordRefSys.createFromEpsg(idEpsgRSGoogle)
147 | if not createCrs:
148 | google_proj_def = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +\
149 | lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 "
150 | google_proj_def += "+units=m +nadgrids=@null +wktext +no_defs"
151 | isOk = coordRefSys.createFromProj4(google_proj_def)
152 | if not isOk:
153 | return None
154 | return coordRefSys
155 |
--------------------------------------------------------------------------------
/tmsforkorea/help/source/conf.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #
3 | # openlayersplugin documentation build configuration file, created by
4 | # sphinx-quickstart on Sun Feb 12 17:11:03 2012.
5 | #
6 | # This file is execfile()d with the current directory set to its containing dir.
7 | #
8 | # Note that not all possible configuration values are present in this
9 | # autogenerated file.
10 | #
11 | # All configuration values have a default; values that are commented out
12 | # serve to show the default.
13 |
14 | import sys, os
15 |
16 | # If extensions (or modules to document with autodoc) are in another directory,
17 | # add these directories to sys.path here. If the directory is relative to the
18 | # documentation root, use os.path.abspath to make it absolute, like shown here.
19 | #sys.path.insert(0, os.path.abspath('.'))
20 |
21 | # -- General configuration -----------------------------------------------------
22 |
23 | # If your documentation needs a minimal Sphinx version, state it here.
24 | #needs_sphinx = '1.0'
25 |
26 | # Add any Sphinx extension module names here, as strings. They can be extensions
27 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
28 | extensions = ['sphinx.ext.todo', 'sphinx.ext.pngmath', 'sphinx.ext.viewcode']
29 |
30 | # Add any paths that contain templates here, relative to this directory.
31 | templates_path = ['_templates']
32 |
33 | # The suffix of source filenames.
34 | source_suffix = '.rst'
35 |
36 | # The encoding of source files.
37 | #source_encoding = 'utf-8-sig'
38 |
39 | # The master toctree document.
40 | master_doc = 'index'
41 |
42 | # General information about the project.
43 | project = u'openlayersplugin'
44 | copyright = u'2013, Sourcepole and contributors'
45 |
46 | # The version info for the project you're documenting, acts as replacement for
47 | # |version| and |release|, also used in various other places throughout the
48 | # built documents.
49 | #
50 | # The short X.Y version.
51 | version = '1.3'
52 | # The full version, including alpha/beta/rc tags.
53 | release = '1.3'
54 |
55 | # The language for content autogenerated by Sphinx. Refer to documentation
56 | # for a list of supported languages.
57 | #language = None
58 |
59 | # There are two options for replacing |today|: either, you set today to some
60 | # non-false value, then it is used:
61 | #today = ''
62 | # Else, today_fmt is used as the format for a strftime call.
63 | #today_fmt = '%B %d, %Y'
64 |
65 | # List of patterns, relative to source directory, that match files and
66 | # directories to ignore when looking for source files.
67 | exclude_patterns = []
68 |
69 | # The reST default role (used for this markup: `text`) to use for all documents.
70 | #default_role = None
71 |
72 | # If true, '()' will be appended to :func: etc. cross-reference text.
73 | #add_function_parentheses = True
74 |
75 | # If true, the current module name will be prepended to all description
76 | # unit titles (such as .. function::).
77 | #add_module_names = True
78 |
79 | # If true, sectionauthor and moduleauthor directives will be shown in the
80 | # output. They are ignored by default.
81 | #show_authors = False
82 |
83 | # The name of the Pygments (syntax highlighting) style to use.
84 | pygments_style = 'sphinx'
85 |
86 | # A list of ignored prefixes for module index sorting.
87 | #modindex_common_prefix = []
88 |
89 |
90 | # -- Options for HTML output ---------------------------------------------------
91 |
92 | # The theme to use for HTML and HTML Help pages. See the documentation for
93 | # a list of builtin themes.
94 | html_theme = 'default'
95 |
96 | # Theme options are theme-specific and customize the look and feel of a theme
97 | # further. For a list of options available for each theme, see the
98 | # documentation.
99 | #html_theme_options = {}
100 |
101 | # Add any paths that contain custom themes here, relative to this directory.
102 | #html_theme_path = []
103 |
104 | # The name for this set of Sphinx documents. If None, it defaults to
105 | # " v documentation".
106 | #html_title = None
107 |
108 | # A shorter title for the navigation bar. Default is the same as html_title.
109 | #html_short_title = None
110 |
111 | # The name of an image file (relative to this directory) to place at the top
112 | # of the sidebar.
113 | #html_logo = None
114 |
115 | # The name of an image file (within the static path) to use as favicon of the
116 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
117 | # pixels large.
118 | #html_favicon = None
119 |
120 | # Add any paths that contain custom static files (such as style sheets) here,
121 | # relative to this directory. They are copied after the builtin static files,
122 | # so a file named "default.css" will overwrite the builtin "default.css".
123 | html_static_path = ['_static']
124 |
125 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
126 | # using the given strftime format.
127 | #html_last_updated_fmt = '%b %d, %Y'
128 |
129 | # If true, SmartyPants will be used to convert quotes and dashes to
130 | # typographically correct entities.
131 | #html_use_smartypants = True
132 |
133 | # Custom sidebar templates, maps document names to template names.
134 | #html_sidebars = {}
135 |
136 | # Additional templates that should be rendered to pages, maps page names to
137 | # template names.
138 | #html_additional_pages = {}
139 |
140 | # If false, no module index is generated.
141 | #html_domain_indices = True
142 |
143 | # If false, no index is generated.
144 | #html_use_index = True
145 |
146 | # If true, the index is split into individual pages for each letter.
147 | #html_split_index = False
148 |
149 | # If true, links to the reST sources are added to the pages.
150 | #html_show_sourcelink = True
151 |
152 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
153 | #html_show_sphinx = True
154 |
155 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
156 | #html_show_copyright = True
157 |
158 | # If true, an OpenSearch description file will be output, and all pages will
159 | # contain a tag referring to it. The value of this option must be the
160 | # base URL from which the finished HTML is served.
161 | #html_use_opensearch = ''
162 |
163 | # This is the file name suffix for HTML files (e.g. ".xhtml").
164 | #html_file_suffix = None
165 |
166 | # Output file base name for HTML help builder.
167 | htmlhelp_basename = 'templateclassdoc'
168 |
169 |
170 | # -- Options for LaTeX output --------------------------------------------------
171 |
172 | # The paper size ('letter' or 'a4').
173 | #latex_paper_size = 'letter'
174 |
175 | # The font size ('10pt', '11pt' or '12pt').
176 | #latex_font_size = '10pt'
177 |
178 | # Grouping the document tree into LaTeX files. List of tuples
179 | # (source start file, target name, title, author, documentclass [howto/manual]).
180 | latex_documents = [
181 | ('index', 'openlayersplugin.tex', u'openlayersplugin Documentation',
182 | u'Sourcepole and contributors', 'manual'),
183 | ]
184 |
185 | # The name of an image file (relative to this directory) to place at the top of
186 | # the title page.
187 | #latex_logo = None
188 |
189 | # For "manual" documents, if this is true, then toplevel headings are parts,
190 | # not chapters.
191 | #latex_use_parts = False
192 |
193 | # If true, show page references after internal links.
194 | #latex_show_pagerefs = False
195 |
196 | # If true, show URL addresses after external links.
197 | #latex_show_urls = False
198 |
199 | # Additional stuff for the LaTeX preamble.
200 | #latex_preamble = ''
201 |
202 | # Documents to append as an appendix to all manuals.
203 | #latex_appendices = []
204 |
205 | # If false, no module index is generated.
206 | #latex_domain_indices = True
207 |
208 |
209 | # -- Options for manual page output --------------------------------------------
210 |
211 | # One entry per manual page. List of tuples
212 | # (source start file, name, description, authors, manual section).
213 | man_pages = [
214 | ('index', 'templateclass', u'openlayersplugin Documentation',
215 | [u'Sourcepole and contributors'], 1)
216 | ]
217 |
--------------------------------------------------------------------------------
/tmsforkorea/openlayers_ovwidget.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | /***************************************************************************
4 | Openlayers Overview - A QGIS plugin to show map in browser(google maps and others)
5 | -------------------
6 | begin : 2011-03-01
7 | copyright : (C) 2011 by Luiz Motta
8 | author : Luiz P. Motta
9 | email : motta _dot_ luiz _at_ gmail.com
10 | ***************************************************************************/
11 |
12 | /***************************************************************************
13 | * *
14 | * This program is free software; you can redistribute it and/or modify *
15 | * it under the terms of the GNU General Public License as published by *
16 | * the Free Software Foundation; either version 2 of the License, or *
17 | * (at your option) any later version. *
18 | * *
19 | ***************************************************************************/
20 | This script initializes the plugin, making it known to QGIS.
21 | """
22 | import os.path
23 |
24 | from qgis.PyQt.QtCore import QObject, QTimer, Qt, QUrl, pyqtSlot
25 | from qgis.PyQt.QtWidgets import (QWidget, QMessageBox, QApplication,
26 | QFileDialog, QDockWidget)
27 | from qgis.PyQt.QtGui import QIcon, QPainter, QImage, QGuiApplication
28 | from qgis.core import (QgsGeometry, QgsPointXY, QgsRectangle,
29 | QgsCoordinateReferenceSystem, QgsCoordinateTransform,
30 | QgsProject, QgsLogger)
31 | from qgis.gui import QgsVertexMarker, QgsMapCanvas
32 | from . import bindogr
33 |
34 | from .ui_openlayers_ovwidget import Ui_Form
35 |
36 |
37 | class MarkerCursor(QObject):
38 |
39 | def __init__(self, mapCanvas, srsOL):
40 | QObject.__init__(self)
41 | self.__srsOL = srsOL
42 | self.__canvas = mapCanvas
43 | self.__marker = None
44 | self.__showMarker = True
45 |
46 | def __del__(self):
47 | self.reset()
48 |
49 | def __refresh(self, pointCenter):
50 | if self.__marker is not None:
51 | self.reset()
52 | self.__marker = QgsVertexMarker(self.__canvas)
53 | self.__marker.setCenter(pointCenter)
54 | self.__marker.setIconType(QgsVertexMarker.ICON_X)
55 | self.__marker.setPenWidth(4)
56 |
57 | def setVisible(self, visible):
58 | self.__showMarker = visible
59 |
60 | def reset(self):
61 | self.__canvas.scene().removeItem(self.__marker)
62 | del self.__marker
63 | self.__marker = None
64 |
65 | @pyqtSlot(str)
66 | def changeMarker(self, strListExtent):
67 | if not self.__showMarker:
68 | return
69 | # left, bottom, right, top
70 | left, bottom, right, top = [float(item) for item in
71 | strListExtent.split(',')]
72 | pointCenter = QgsRectangle(QgsPointXY(left, top),
73 | QgsPointXY(right, bottom)).center()
74 | crsCanvas = self.__canvas.mapSettings().destinationCrs()
75 | if self.__srsOL != crsCanvas:
76 | try:
77 | coodTrans = core.QgsCoordinateTransform(self.__srsOL, crsCanvas)
78 | pointCenter = coodTrans.transform(pointCenter, core.QgsCoordinateTransform.ForwardTransform)
79 | except:
80 | pass
81 | self.__refresh(pointCenter)
82 |
83 |
84 | class OpenLayersOverviewWidget(QWidget, Ui_Form):
85 |
86 | def __init__(self, iface, dockwidget, olLayerTypeRegistry):
87 | QWidget.__init__(self)
88 | Ui_Form.__init__(self)
89 | self.setupUi(self)
90 | self.__canvas = iface.mapCanvas()
91 | self.__dockwidget = dockwidget
92 | self.__olLayerTypeRegistry = olLayerTypeRegistry
93 | self.__initLayerOL = False
94 | self.__fileNameImg = ''
95 | self.__srsOL = QgsCoordinateReferenceSystem(
96 | 3857, QgsCoordinateReferenceSystem.EpsgCrsId)
97 | self.__marker = MarkerCursor(self.__canvas, self.__srsOL)
98 | self.__manager = None # Need persist for PROXY
99 | bindogr.initOgr()
100 | self.__init()
101 |
102 | def __init(self):
103 | self.checkBoxHideCross.setEnabled(False)
104 | self.__populateTypeMapGUI()
105 | self.__populateButtonBox()
106 | self.__registerObjJS()
107 | self.lbStatusRead.setVisible(False)
108 | self.__setConnections()
109 |
110 | self.__timerMapReady = QTimer()
111 | self.__timerMapReady.setSingleShot(True)
112 | self.__timerMapReady.setInterval(20)
113 | self.__timerMapReady.timeout.connect(self.__checkMapReady)
114 |
115 | def __del__(self):
116 | self.__marker.reset()
117 | # Disconnect Canvas
118 | # Canvas
119 | QgsMapCanvas.extentsChanged.disconnect(self.__canvas)
120 | # Doc WidgetparentWidget
121 | QDockWidget.visibilityChanged.disconnect(self.__dockwidget)
122 |
123 | def __populateButtonBox(self):
124 | pathPlugin = "%s%s%%s" % (os.path.dirname(__file__), os.path.sep)
125 | self.pbRefresh.setIcon(QIcon(pathPlugin % "mActionDraw.png"))
126 | self.pbRefresh.setEnabled(False)
127 | self.pbAddRaster.setIcon(QIcon(pathPlugin %
128 | "mActionAddRasterLayer.png"))
129 | self.pbAddRaster.setEnabled(False)
130 | self.pbCopyKml.setIcon(QIcon(pathPlugin % "kml.png"))
131 | self.pbCopyKml.setEnabled(False)
132 | self.pbSaveImg.setIcon(QIcon(pathPlugin % "mActionSaveMapAsImage.png"))
133 | self.pbSaveImg.setEnabled(False)
134 |
135 | def __populateTypeMapGUI(self):
136 | pathPlugin = "%s%s%%s" % (os.path.dirname(__file__), os.path.sep)
137 | totalLayers = len(self.__olLayerTypeRegistry.types())
138 | for id in range(totalLayers):
139 | layer = self.__olLayerTypeRegistry.getById(id)
140 | name = str(layer.displayName)
141 | icon = QIcon(pathPlugin % layer.groupIcon)
142 | self.comboBoxTypeMap.addItem(icon, name, id)
143 |
144 | def __setConnections(self):
145 | # Check Box
146 | self.checkBoxEnableMap.stateChanged.connect(
147 | self.__signal_checkBoxEnableMap_stateChanged)
148 | self.checkBoxHideCross.stateChanged.connect(
149 | self.__signal_checkBoxHideCross_stateChanged)
150 | # comboBoxTypeMap
151 | self.comboBoxTypeMap.currentIndexChanged.connect(
152 | self.__signal_comboBoxTypeMap_currentIndexChanged)
153 | # Canvas
154 | self.__canvas.extentsChanged.connect(
155 | self.__signal_canvas_extentsChanged)
156 | # Doc WidgetparentWidget
157 | self.__dockwidget.visibilityChanged.connect(
158 | self.__signal_DocWidget_visibilityChanged)
159 | # WebView Map
160 | self.webViewMap.page().mainFrame().javaScriptWindowObjectCleared.connect(
161 | self.__registerObjJS)
162 | # Push Button
163 | self.pbRefresh.clicked.connect(
164 | self.__signal_pbRefresh_clicked)
165 | self.pbAddRaster.clicked.connect(
166 | self.__signal_pbAddRaster_clicked)
167 | self.pbCopyKml.clicked.connect(
168 | self.__signal_pbCopyKml_clicked)
169 | self.pbSaveImg.clicked.connect(
170 | self.__signal_pbSaveImg_clicked)
171 |
172 | def __registerObjJS(self):
173 | self.webViewMap.page().mainFrame().addToJavaScriptWindowObject(
174 | "MarkerCursorQGis", self.__marker)
175 |
176 | def __signal_checkBoxEnableMap_stateChanged(self, state):
177 | enable = False
178 | if state == Qt.Unchecked:
179 | self.__marker.reset()
180 | else:
181 | if self.__canvas.layerCount() == 0:
182 | QMessageBox.warning(self, QApplication.translate(
183 | "OpenLayersOverviewWidget",
184 | "OpenLayers Overview"), QApplication.translate(
185 | "OpenLayersOverviewWidget",
186 | "At least one layer in map canvas required"))
187 | self.checkBoxEnableMap.setCheckState(Qt.Unchecked)
188 | else:
189 | enable = True
190 | if not self.__initLayerOL:
191 | self.__initLayerOL = True
192 | self.__setWebViewMap(0)
193 | else:
194 | self.__refreshMapOL()
195 | # GUI
196 | if enable:
197 | self.lbStatusRead.setVisible(False)
198 | self.webViewMap.setVisible(True)
199 | else:
200 | self.lbStatusRead.setText("")
201 | self.lbStatusRead.setVisible(True)
202 | self.webViewMap.setVisible(False)
203 | self.webViewMap.setEnabled(enable)
204 | self.comboBoxTypeMap.setEnabled(enable)
205 | self.pbRefresh.setEnabled(enable)
206 | self.pbAddRaster.setEnabled(enable)
207 | self.pbCopyKml.setEnabled(enable)
208 | self.pbSaveImg.setEnabled(enable)
209 | self.checkBoxHideCross.setEnabled(enable)
210 |
211 | def __signal_checkBoxHideCross_stateChanged(self, state):
212 | if state == Qt.Checked:
213 | self.__marker.reset()
214 | self.__marker.setVisible(False)
215 | else:
216 | self.__marker.setVisible(True)
217 | self.__refreshMapOL()
218 |
219 | def __signal_DocWidget_visibilityChanged(self, visible):
220 | if self.__canvas.layerCount() == 0:
221 | return
222 | self.checkBoxEnableMap.setCheckState(Qt.Unchecked)
223 | self.__signal_checkBoxEnableMap_stateChanged(Qt.Unchecked)
224 |
225 | def __signal_comboBoxTypeMap_currentIndexChanged(self, index):
226 | self.__setWebViewMap(index)
227 |
228 | def __signal_canvas_extentsChanged(self):
229 | if self.__canvas.layerCount() == 0 or not self.webViewMap.isVisible():
230 | return
231 | if self.checkBoxEnableMap.checkState() == Qt.Checked:
232 | self.__refreshMapOL()
233 |
234 | def __signal_pbRefresh_clicked(self, checked):
235 | index = self.comboBoxTypeMap.currentIndex()
236 | self.__setWebViewMap(index)
237 |
238 | def __signal_pbAddRaster_clicked(self, checked):
239 | index = self.comboBoxTypeMap.currentIndex()
240 | layer = self.__olLayerTypeRegistry.getById(index)
241 | QGuiApplication.setOverrideCursor(Qt.WaitCursor)
242 | layer.addLayer()
243 | QGuiApplication.restoreOverrideCursor()
244 |
245 | def __signal_pbCopyKml_clicked(self, cheked):
246 | # Extent Openlayers
247 | action = "map.getExtent().toGeometry().toString();"
248 | wkt = self.webViewMap.page().mainFrame().evaluateJavaScript(action)
249 | rect = QgsGeometry.fromWkt(wkt).boundingBox()
250 | srsGE = QgsCoordinateReferenceSystem(
251 | 4326, QgsCoordinateReferenceSystem.EpsgCrsId)
252 | coodTrans = QgsCoordinateTransform(self.__srsOL, srsGE,
253 | QgsProject.instance())
254 | rect = coodTrans.transform(
255 | rect, QgsCoordinateTransform.ForwardTransform)
256 | line = QgsGeometry.fromRect(rect).asPolygon()[0]
257 | wkt = str(QgsGeometry.fromPolylineXY(line).asWkt())
258 | # Kml
259 | proj4 = str(srsGE.toProj4())
260 | kmlLine = bindogr.exportKml(wkt, proj4)
261 | kml = ""\
262 | "" \
266 | "" \
267 | "KML from Plugin Openlayers Overview for QGIS" \
268 | "Extent of openlayers map from Plugin Openlayers \
269 | Overview for QGIS"\
270 | "%s" \
271 | "" % kmlLine
272 | clipBoard = QApplication.clipboard()
273 | clipBoard.setText(kml)
274 |
275 | def __signal_pbSaveImg_clicked(self, cheked):
276 | if type(self.__fileNameImg) == tuple:
277 | self.__fileNameImg = self.__fileNameImg[0]
278 | fileName = QFileDialog.getSaveFileName(self,
279 | QApplication.translate(
280 | "OpenLayersOverviewWidget",
281 | "Save image"),
282 | self.__fileNameImg,
283 | QApplication.translate(
284 | "OpenLayersOverviewWidget",
285 | "Image(*.jpg)"))
286 | if not fileName == '':
287 | self.__fileNameImg = fileName
288 | else:
289 | return
290 | img = QImage(self.webViewMap.page().mainFrame().contentsSize(),
291 | QImage.Format_ARGB32_Premultiplied)
292 | imgPainter = QPainter()
293 | imgPainter.begin(img)
294 | self.webViewMap.page().mainFrame().render(imgPainter)
295 | imgPainter.end()
296 | img.save(fileName[0], "JPEG")
297 |
298 | def __signal_webViewMap_loadFinished(self, ok):
299 | if ok is False:
300 | QMessageBox.warning(self, QApplication.translate(
301 | "OpenLayersOverviewWidget", "OpenLayers Overview"),
302 | QApplication.translate(
303 | "OpenLayersOverviewWidget",
304 | "Error loading page!"))
305 | else:
306 | # wait until OpenLayers map is ready
307 | self.__checkMapReady()
308 | self.lbStatusRead.setVisible(False)
309 | self.webViewMap.setVisible(True)
310 | self.webViewMap.page().mainFrame().loadFinished.disconnect(
311 | self.__signal_webViewMap_loadFinished)
312 |
313 | def __setWebViewMap(self, id):
314 | layer = self.__olLayerTypeRegistry.getById(id)
315 | self.lbStatusRead.setText("Loading " + layer.displayName + " ...")
316 | self.lbStatusRead.setVisible(True)
317 | self.webViewMap.setVisible(False)
318 | self.webViewMap.page().mainFrame().loadFinished.connect(
319 | self.__signal_webViewMap_loadFinished)
320 | url = layer.html_url()
321 | self.webViewMap.page().mainFrame().load(QUrl(url))
322 |
323 | def __checkMapReady(self):
324 | if self.webViewMap.page().mainFrame().evaluateJavaScript(
325 | "map != undefined"):
326 | # map ready
327 | self.__refreshMapOL()
328 | else:
329 | # wait for map
330 | self.__timerMapReady.start()
331 |
332 | def __refreshMapOL(self):
333 | # catch Exception where lat/long exceed limit of the loaded layer
334 | # the Exception name is unknown
335 | latlon = None
336 | try:
337 | latlon = self.__getCenterLongLat2OL()
338 | except Exception as e:
339 | QgsLogger().warning(e.args[0])
340 |
341 | if latlon:
342 | action = "map.setCenter(new OpenLayers.LonLat(%f, %f));" % (latlon)
343 | self.webViewMap.page().mainFrame().evaluateJavaScript(action)
344 | action = "map.zoomToScale(%f);" % self.__canvas.scale()
345 | self.webViewMap.page().mainFrame().evaluateJavaScript(action)
346 | self.webViewMap.page().mainFrame().evaluateJavaScript(
347 | "oloMarker.changeMarker();")
348 |
349 | def __getCenterLongLat2OL(self):
350 | pntCenter = self.__canvas.extent().center()
351 | crsCanvas = self.__canvas.mapSettings().destinationCrs()
352 | if crsCanvas != self.__srsOL:
353 | coodTrans = QgsCoordinateTransform(crsCanvas, self.__srsOL,
354 | QgsProject.instance())
355 | pntCenter = coodTrans.transform(
356 | pntCenter, QgsCoordinateTransform.ForwardTransform)
357 | return tuple([pntCenter.x(), pntCenter.y()])
358 |
--------------------------------------------------------------------------------