minorua / TileLayerPlugin

[QGIS2 Plugin] add a web tile map as a layer onto your map canvas
https://github.com/minorua/TileLayerPlugin/wiki
53 stars 16 forks source link

TileLayerPlugin

TileLayerPlugin is a plugin to add tiled maps on your map canvas.

How to use?

TileLayerPlugin is under the Web menu. Only tile frame layers are listed in the add tile layer dialog until you add layer definitions by yourself. You can add available layers by writing a file in the format described below and setting the folder that the file exists as external layer definition directory (If you make it in the layers directory in the plugin, you will lose it when the plugin is updated). A list of prepared layer definition files is here.

A few layer styles can be changed in the layer properties dialog. You can set sufficient cache size (in kilobytes) in the Network/Cache Settings of the Options dialog in order to make effective use of cache.

You can save currently visible tile images by clicking the "Save tiles" entry in the context menu. Directory select dialog will open, and each individual tile image will be saved in the selected directory.

Limitations

Layer definition file format

Layer definition file is a text file. Each line has information for a tile layer. Fields are separated with tab character. The file extension is tsv and the file encoding is UTF-8.

Line format is:
title attribution url yOriginTop zmin zmax xmin ymin xmax ymax

Description of fields:
Required

Options

Notes

Examples of layer definition file

Note: Use tab character to separate fields!

Known issue(s)

Adding a TileLayer from Python

plugin = qgis.utils.plugins.get("TileLayerPlugin")
if plugin:
  from TileLayerPlugin.tiles import BoundingBox, TileLayerDefinition
  bbox = None    # BoundingBox(-180, -85.05, 180, 85.05)
  layerdef = TileLayerDefinition(u"title",
                                 u"attribution",
                                 "http://example.com/xyz/{z}/{x}/{y}.png",
                                 zmin=1,
                                 zmax=18,
                                 bbox=bbox)
  plugin.addTileLayer(layerdef)
else:
  from PyQt4.QtGui import QMessageBox
  QMessageBox.warning(None,
                      u"TileLayerPlugin not installed",
                      u"Please install it and try again.")

ChangeLog

Version 0.80

Version 0.70

Version 0.60

Version 0.50.1

version 0.50

version 0.40

version 0.30

version 0.20

License

TileLayerPlugin 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.

Copyright (c) 2013 Minoru Akagi