Skip to content

Print Plugin: Configurable Default Projection #11955

@rowheat02

Description

@rowheat02

Description

The Print plugin does not allow configuring which projection is selected by default when the print dialog opens. The selection always fell back to the map projection or EPSG:3857.

Solution

Projection options are already supported via projectionOptions.projections (list of available CRS in the dropdown). The plugin should now support an optional default projection so the dialog opens with a chosen CRS pre-selected.

Configuration

Under the Print plugin cfg, use projectionOptions.defaultProjection. It should be one of the values from your projectionOptions.projections list.

Example (localConfig.json):

{
  "name": "Print",
  "cfg": {
    "projectionOptions": {
      "projections": [
        {"name": "EPSG:32122 (Ohio North)", "value": "EPSG:32122"},
        {"name": "EPSG:3857", "value": "EPSG:3857"},
        {"name": "EPSG:4326", "value": "EPSG:4326"}
      ],
      "defaultProjection": "EPSG:32122"
    }
  }
}

If defaultProjection is omitted, behavior is unchanged (map projection or EPSG:3857).

What kind of improvement you want to add? (check one with "x", remove the others)

  • Enhancement

Other useful information

Note: For any projection other than EPSG:4326 or EPSG:3857, you must define it in projectionDefs (with code, def, extent, worldExtent) so the map and preview render correctly.

Metadata

Metadata

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions