示例#1
0
    def manageGui(self):
        self.leDirectoryName.setText(self.settings.value("lastUsedDir", "."))

        layers = utils.getMapLayers()
        relations = self.iface.legendInterface().groupLayerRelationship()
        for layer in sorted(layers.iteritems(), cmp=locale.strcoll, key=operator.itemgetter(1)):
            groupName = utils.getLayerGroup(relations, layer[0])
            if groupName == "":
                self.cmbLayers.addItem(layer[1], layer[0])
            else:
                self.cmbLayers.addItem("%s - %s" % (layer[1], groupName), layer[0])
        self.rbOutputZip.setChecked(self.settings.value("outputToZip", True, type=bool))
        self.rbOutputDir.setChecked(self.settings.value("outputToDir", False, type=bool))
        if self.rbOutputZip.isChecked():
            self.leDirectoryName.setEnabled(False)
        else:
            self.leZipFileName.setEnabled(False)
        self.cmbLayers.setEnabled(False)
        self.leRootDir.setText(self.settings.value("rootDir", "Mapnik"))
        self.rbExtentCanvas.setChecked(self.settings.value("extentCanvas", True, type=bool))
        self.rbExtentFull.setChecked(self.settings.value("extentFull", False, type=bool))
        self.rbExtentLayer.setChecked(self.settings.value("extentLayer", False, type=bool))
        self.spnZoomMin.setValue(self.settings.value("minZoom", 0, type=int))
        self.spnZoomMax.setValue(self.settings.value("maxZoom", 18, type=int))
        self.chkLockRatio.setChecked(self.settings.value("keepRatio", True, type=bool))
        self.spnTileWidth.setValue(self.settings.value("tileWidth", 256, type=int))
        self.spnTileHeight.setValue(self.settings.value("tileHeight", 256, type=int))
        self.spnTransparency.setValue(self.settings.value("transparency", 255, type=int))
        self.spnQuality.setValue(self.settings.value("quality", 70, type=int))
        self.cmbFormat.setCurrentIndex(int(self.settings.value("format", 0)))
        self.chkAntialiasing.setChecked(self.settings.value("enable_antialiasing", False, type=bool))
        self.chkTMSConvention.setChecked(self.settings.value("use_tms_filenames", False, type=bool))
        self.chkWriteMapurl.setChecked(self.settings.value("write_mapurl", False, type=bool))
        self.chkWriteViewer.setChecked(self.settings.value("write_viewer", False, type=bool))
        self.formatChanged()
示例#2
0
 def manageGui(self):
     layers = utils.getMapLayers()
     relations = self.iface.legendInterface().groupLayerRelationship()
     for layer in sorted(layers.iteritems(), cmp=locale.strcoll, key=operator.itemgetter(1)):
         groupName = utils.getLayerGroup(relations, layer[0])
         if groupName == '':
             self.cmbLayers.addItem(layer[1], layer[0])
         else:
             self.cmbLayers.addItem('%s - %s' % (layer[1], groupName), layer[0])
     self.rbOutputZip.setChecked(self.settings.value('outputToZip', True, type=bool))
     self.rbOutputDir.setChecked(self.settings.value('outputToDir', False, type=bool))
     if self.rbOutputZip.isChecked():
         self.leDirectoryName.setEnabled(False)
     else:
         self.leZipFileName.setEnabled(False)
     self.cmbLayers.setEnabled(False)
     self.leRootDir.setText(self.settings.value('rootDir', 'Mapnik'))
     self.rbExtentCanvas.setChecked(self.settings.value('extentCanvas', True, type=bool))
     self.rbExtentFull.setChecked(self.settings.value('extentFull', False, type=bool))
     self.rbExtentLayer.setChecked(self.settings.value('extentLayer', False, type=bool))
     self.spnZoomMin.setValue(self.settings.value('minZoom', 0, type=int))
     self.spnZoomMax.setValue(self.settings.value('maxZoom', 18, type=int))
     self.chkLockRatio.setChecked(self.settings.value('keepRatio', True, type=bool))
     self.spnTileWidth.setValue(self.settings.value('tileWidth', 256, type=int))
     self.spnTileHeight.setValue(self.settings.value('tileHeight', 256, type=int))
     self.spnTransparency.setValue(self.settings.value('transparency', 255, type=int))
     self.spnQuality.setValue(self.settings.value('quality', 70, type=int))
     self.cmbFormat.setCurrentIndex(int(self.settings.value('format', 0)))
     self.chkAntialiasing.setChecked(self.settings.value('enable_antialiasing', False, type=bool))
     self.chkTMSConvention.setChecked(self.settings.value('use_tms_filenames', False, type=bool))
     self.chkWriteMapurl.setChecked(self.settings.value("write_mapurl", False, type=bool))
     self.chkWriteViewer.setChecked(self.settings.value("write_viewer", False, type=bool))
     self.formatChanged()
示例#3
0
    def manageGui(self):
        # populate combobox with layers
        layers = utils.getMapLayers()
        relations = self.iface.legendInterface().groupLayerRelationship()
        for layer in sorted(layers.iteritems(), cmp=locale.strcoll,
                            key=operator.itemgetter(1)):
            groupName = utils.getLayerGroup(relations, layer[0])
            if groupName == '':
                self.cmbLayers.addItem(layer[1], layer[0])
            else:
                self.cmbLayers.addItem('%s - %s' % (layer[1], groupName),
                                       layer[0])

        # restore ui state from settings
        self.rbOutputZip.setChecked(self.settings.value('outputToZip', True,
                                    type=bool))
        self.rbOutputDir.setChecked(self.settings.value('outputToDir', False,
                                    type=bool))

        if self.rbOutputZip.isChecked():
            self.leDirectoryName.setEnabled(False)
        else:
            self.leZipFileName.setEnabled(False)

        self.cmbLayers.setEnabled(False)

        self.leRootDir.setText(self.settings.value('rootDir', 'Mapnik'))

        self.rbExtentCanvas.setChecked(
                self.settings.value('extentCanvas', True, type=bool))
        self.rbExtentFull.setChecked(
                self.settings.value('extentFull', False, type=bool))
        self.rbExtentLayer.setChecked(
                self.settings.value('extentLayer', False, type=bool))

        self.spnZoomMin.setValue(self.settings.value('minZoom', 0, type=int))
        self.spnZoomMax.setValue(self.settings.value('maxZoom', 18, type=int))

        self.chkLockRatio.setChecked(
                self.settings.value('keepRatio', True, type=bool))
        self.spnTileWidth.setValue(
                self.settings.value('tileWidth', 256, type=int))
        self.spnTileHeight.setValue(
                self.settings.value('tileHeight', 256, type=int))

        self.spnTransparency.setValue(
                self.settings.value('transparency', 255, type=int))
        self.leSuffix.setText(self.settings.value('suffix', 'png'))
        self.chkAntialiasing.setChecked(
                self.settings.value('enable_antialiasing', False, type=bool))
        self.chkTMSConvention.setChecked(
                self.settings.value('use_tms_filenames', False, type=bool))

        self.chkWriteMapurl.setChecked(
                self.settings.value("write_mapurl", False, type=bool))
        self.chkWriteViewer.setChecked(
                self.settings.value("write_viewer", False, type=bool))
示例#4
0
    def manageGui(self):
        # populate combobox with layers
        layers = utils.getMapLayers()
        relations = self.iface.legendInterface().groupLayerRelationship()
        for layer in sorted(layers.iteritems(),
                            cmp=locale.strcoll,
                            key=operator.itemgetter(1)):
            groupName = utils.getLayerGroup(relations, layer[0])
            if groupName == "":
                self.cmbLayers.addItem(layer[1], layer[0])
            else:
                self.cmbLayers.addItem("%s - %s" % (layer[1], groupName),
                                       layer[0])

        # restore ui state from settings
        self.rbOutputZip.setChecked(
            self.settings.value("outputToZip", True, type=bool))
        self.rbOutputDir.setChecked(
            self.settings.value("outputToDir", False, type=bool))

        if self.rbOutputZip.isChecked():
            self.leDirectoryName.setEnabled(False)
        else:
            self.leZipFileName.setEnabled(False)

        self.cmbLayers.setEnabled(False)

        self.leRootDir.setText(self.settings.value("rootDir", "Mapnik"))

        self.rbExtentCanvas.setChecked(
            self.settings.value("extentCanvas", True, type=bool))
        self.rbExtentFull.setChecked(
            self.settings.value("extentFull", False, type=bool))
        self.rbExtentLayer.setChecked(
            self.settings.value("extentLayer", False, type=bool))

        self.spnZoomMin.setValue(self.settings.value("minZoom", 0, type=int))
        self.spnZoomMax.setValue(self.settings.value("maxZoom", 18, type=int))

        self.chkLockRatio.setChecked(
            self.settings.value("keepRatio", True, type=bool))
        self.spnTileWidth.setValue(
            self.settings.value("tileWidth", 256, type=int))
        self.spnTileHeight.setValue(
            self.settings.value("tileHeight", 256, type=int))

        self.chkAntialiasing.setChecked(
            self.settings.value("enable_antialiasing", False, type=bool))
        self.chkTMSConvention.setChecked(
            self.settings.value("use_tms_filenames", False, type=bool))

        self.chkWriteMapurl.setChecked(
            self.settings.value("write_mapurl", False, type=bool))
        self.chkWriteViewer.setChecked(
            self.settings.value("write_viewer", False, type=bool))
示例#5
0
    def manageGui(self):
        layers = utils.getMapLayers()
        relations = self.iface.legendInterface().groupLayerRelationship()
        for layer in sorted(layers.iteritems(), cmp=locale.strcoll, key=operator.itemgetter(1)):
            groupName = utils.getLayerGroup(relations, layer[0])
            if groupName == '':
                self.cmbLayers.addItem(layer[1], layer[0])
            else:
                self.cmbLayers.addItem('%s - %s' % (layer[1], groupName), layer[0])

        self.rbOutputZip.setChecked(self.settings.value('outputToZip', True, type=bool))
        self.rbOutputDir.setChecked(self.settings.value('outputToDir', False, type=bool))
        self.rbOutputNGM.setChecked(self.settings.value('outputToNGM', False, type=bool))
        if self.rbOutputZip.isChecked():
            self.leDirectoryName.setEnabled(False)
            self.leTilesFroNGM.setEnabled(False)
        elif self.rbOutputDir.isChecked():
            self.leZipFileName.setEnabled(False)
            self.leTilesFroNGM.setEnabled(False)
        elif self.rbOutputNGM.isChecked():
            self.leZipFileName.setEnabled(False)
            self.leDirectoryName.setEnabled(False)
        else:
            self.leZipFileName.setEnabled(False)
            self.leDirectoryName.setEnabled(False)
            self.leTilesFroNGM.setEnabled(False)

        self.leZipFileName.setText(self.settings.value('outputToZip_Path', ''))
        self.leDirectoryName.setText(self.settings.value('outputToDir_Path', ''))
        self.leTilesFroNGM.setText(self.settings.value('outputToNGM_Path', ''))

        self.cmbLayers.setEnabled(False)
        self.leRootDir.setText(self.settings.value('rootDir', 'Mapnik'))
        self.rbExtentCanvas.setChecked(self.settings.value('extentCanvas', True, type=bool))
        self.rbExtentFull.setChecked(self.settings.value('extentFull', False, type=bool))
        self.rbExtentLayer.setChecked(self.settings.value('extentLayer', False, type=bool))
        self.spnZoomMin.setValue(self.settings.value('minZoom', 0, type=int))
        self.spnZoomMax.setValue(self.settings.value('maxZoom', 18, type=int))
        self.chkLockRatio.setChecked(self.settings.value('keepRatio', True, type=bool))
        self.spnTileWidth.setValue(self.settings.value('tileWidth', 256, type=int))
        self.spnTileHeight.setValue(self.settings.value('tileHeight', 256, type=int))
        self.spnTransparency.setValue(self.settings.value('transparency', 255, type=int))
        self.spnQuality.setValue(self.settings.value('quality', 70, type=int))
        self.cmbFormat.setCurrentIndex(int(self.settings.value('format', 0)))
        self.chkAntialiasing.setChecked(self.settings.value('enable_antialiasing', False, type=bool))
        self.chkTMSConvention.setChecked(self.settings.value('use_tms_filenames', False, type=bool))
        self.chkMBTilesCompression.setChecked(self.settings.value('use_mbtiles_compression', False, type=bool))
        self.chkWriteJson.setChecked(self.settings.value("write_json", False, type=bool))
        self.chkWriteOverview.setChecked(self.settings.value("write_overview", False, type=bool))
        self.chkWriteMapurl.setChecked(self.settings.value("write_mapurl", False, type=bool))
        self.chkWriteViewer.setChecked(self.settings.value("write_viewer", False, type=bool))
        self.chkRenderOutsideTiles.setChecked(self.settings.value("renderOutsideTiles", True, type=bool))

        self.formatChanged()
示例#6
0
  def manageGui(self):
    # populate combobox with layers
    layers = utils.getMapLayers()
    relations = self.iface.legendInterface().groupLayerRelationship()
    for layer in sorted(layers.iteritems(), cmp=locale.strcoll, key=operator.itemgetter(1)):
      groupName = utils.getLayerGroup(relations, layer[0])
      if groupName == "":
        self.cmbLayers.addItem(layer[1], layer[0])
      else:
        self.cmbLayers.addItem(QString("%1 - %2").arg(layer[1]).arg(groupName), layer[0])

    # restore ui state from settings
    self.rbOutputZip.setChecked(self.settings.value("outputToZip", True).toBool())
    self.rbOutputDir.setChecked(self.settings.value("outputToDir", False).toBool())

    if self.rbOutputZip.isChecked():
      self.leDirectoryName.setEnabled(False)
    else:
      self.leZipFileName.setEnabled(False)

    self.cmbLayers.setEnabled(False)

    self.leRootDir.setText(self.settings.value("rootDir", "Mapnik").toString())

    self.rbExtentCanvas.setChecked(self.settings.value("extentCanvas", True).toBool())
    self.rbExtentFull.setChecked(self.settings.value("extentFull", False).toBool())
    self.rbExtentLayer.setChecked(self.settings.value("extentLayer", False).toBool())

    self.spnZoomMin.setValue(self.settings.value("minZoom", 0).toInt()[0])
    self.spnZoomMax.setValue(self.settings.value("maxZoom", 18).toInt()[0])

    self.chkLockRatio.setChecked(self.settings.value("keepRatio", True).toBool())
    self.spnTileWidth.setValue(self.settings.value("tileWidth", 256).toInt()[0])
    self.spnTileHeight.setValue(self.settings.value("tileHeight", 256).toInt()[0])

    self.chkAntialiasing.setChecked(self.settings.value("enable_antialiasing", False).toBool())
    self.chkTMSConvention.setChecked(self.settings.value("use_tms_filenames", False).toBool())

    self.chkWriteMapurl.setChecked(self.settings.value("write_mapurl", False).toBool())
    self.chkWriteViewer.setChecked(self.settings.value("write_viewer", False).toBool())