Giter VIP home page Giter VIP logo

maplibre-gl-export's Introduction

maplibre-gl-export's People

Contributors

21601-kimura avatar 2803media avatar adrianql avatar geoyogesh avatar github-actions[bot] avatar jinigarashi avatar leoneljdias avatar renovate[bot] avatar rosslyoung avatar smellman avatar syslev avatar therealroboheart avatar ttolvanen avatar yuchuntsao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

maplibre-gl-export's Issues

The markers should be included in the exported files

I'm struggling to export custom markers.

I would love a simple option to enable/disable the markers on the exported files.

I have no alternatives so far, I've considered modifying the source code myself.

image
the distances in this image are in fact markers, and they are not shown on the exported file.

mapbox-gl-export.umd.js throws Uncaught ReferenceError: Size is not defined

I was using https://github.com/watergis/mapbox-gl-export which is now archived and the dist file from watergis.github.io/mapbox-gl-export/mapbox-gl-export.js which worked fine by including the script.

However, when including www.unpkg.com/@watergis/[email protected]/dist/mapbox-gl-export.umd.js instead, the code throws "Uncaught ReferenceError: Size is not defined", I see that there are differences between the two files but not sure what is causing the issue.

maplibre-gl-export and maplibre-gl-legend

Describe the bug
If I added maplibre-gl-legend.js to a webmap with maplibre-gl-export, I found that the export button disappeared.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://ubukawa.github.io/nyc-map-test/index-test00.html', you will see the export button on top right.
  2. Then, edit html file to add a module for maplibre-gl-legend: https://github.com/ubukawa/nyc-map-test/blob/main/docs/index-test01.html#L12-L15
  3. Go to 'https://ubukawa.github.io/nyc-map-test/index-test01.html', you will NOT see the export button on top right.

Expected behavior
Both legend and export buttons there.

image

Export is not working

Describe the bug
When the plugin is opened, there is the below error occurred.

export-control.tss:247 Uncaught TypeError: Cannot read properties of null (reading 'value')
    at e.default.updatePrintableArea (export-control.tss:247:93)
    at e.default.togglePrintableArea (export-control.tss:237:16)
    at HTMLButtonElement.<anonymous> (export-control.tss:88:14)

Also, the below error is happened when generate button is clicked.

export-control.tss:128 Uncaught TypeError: Cannot read properties of null (reading 'value')
    at HTMLButtonElement.<anonymous> (export-control.tss:128:45)

I don't know which commit this error started to happen...

Even the demo site (https://watergis.github.io/maplibre-gl-export) is also not working...

Expected behavior
When open the plugin, printable area will be shown correctly.
When generate button is clicked, the image will be generated correctly.

Screenshots
image

image

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Lib / dist file error

Describe the bug

Lib folder is not present when you install the module, but it seems to reference some files from this folder. These files do exist in the dist folder though.

Error: ENOENT: no such file or directory, open '<MY_APP_PATH>\node_modules@watergis\maplibre-gl-export\lib\crosshair-manager.ts'

WARNING in ./node_modules/@watergis/maplibre-gl-export/dist/crosshair-manager.js

Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):

Failed to parse source map from '<MY_APP_PATH>\node_modules\@watergis\maplibre-gl-export\lib\crosshair-manager.ts'** file: 

Error: ENOENT: no such file or directory, open '<MY_APP_PATH>\node_modules\@watergis\maplibre-gl-export\lib\crosshair-manager.ts'

image

Additional context
React 18.2.0 using webpack.

3D Terrain with MapLibre v.2.2.0-pre.3

First of all, thank you very much for your great work. I think this is really wonderful work.

Is your feature request related to a problem? Please describe.
When I added "maplibre-gl-export" to one of my test map (Terrain map 3D with maplibre v2.2.0-pre.3) and export the image, I was able to export hill shade from raster DEM but I was not able to export terrain 3D. (See the following picture.)

Describe the solution you'd like
I would like to have an the same terrain 3D map exported.
I thought it would be done if we updated the version of maplibre-gl to 2.2.0-pre.3 from 2.1.9. (in package.json). I could not build by myself in my local PC because I needed more practice on TypeScript.
Do you have any idea for your future development?

Describe alternatives you've considered
Until it support 3D terrain export, I will not add this function to 3D terrain map.
Exporting from 2D map works perfectly.

Additional context
Add any other context or screenshots about the feature request here.
Here is some schreenshot.
2022-07-18-export

Thank you!

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): lock file maintenance

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • chore(deps): update dependency @types/node to v20.12.10
  • chore(deps): update dependency @skeletonlabs/skeleton to v2.10.0
  • chore(deps): update pnpm to v9.1.0
  • chore(deps): update pnpm/action-setup action to v4

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v4
  • pnpm/action-setup v3.0.0
  • actions/setup-node v4
.github/workflows/release.yml
  • actions/checkout v4
  • pnpm/action-setup v3.0.0
  • actions/setup-node v4
  • changesets/action v1
html
packages/mapbox-gl-export/index.html
  • github-fork-ribbon-css 0.2.3
packages/mapbox-gl-export/index_cdn.html
  • github-fork-ribbon-css 0.2.3
packages/maplibre-gl-export/index.html
  • github-fork-ribbon-css 0.2.3
packages/maplibre-gl-export/index_cdn.html
  • github-fork-ribbon-css 0.2.3
npm
package.json
  • @changesets/cli ^2.27.1
  • lefthook ^1.6.5
  • pnpm ^9.0.0
  • pnpm 9.0.6
packages/mapbox-gl-export/package.json
  • js-loading-overlay ^1.2.0
  • mapbox-gl ^3.2.0
  • @types/geojson ^7946.0.14
  • @types/mapbox-gl ^3.1.0
  • @types/node ^20.11.25
  • @typescript-eslint/eslint-plugin ^7.1.1
  • @typescript-eslint/parser ^7.1.1
  • autoprefixer ^10.4.18
  • eslint ^8.57.0
  • eslint-config-prettier ^9.1.0
  • eslint-plugin-import ^2.29.1
  • path ^0.12.7
  • postcss ^8.4.35
  • postcss-cli ^11.0.0
  • prettier ^3.2.5
  • sass ^1.71.1
  • sass-loader ^14.1.1
  • typescript ^5.4.2
  • vite ^5.1.5
packages/maplibre-gl-export/package.json
  • js-loading-overlay ^1.2.0
  • jspdf ^2.5.1
  • maplibre-gl ^4.1.0
  • @types/geojson ^7946.0.14
  • @types/mapbox-gl ^3.1.0
  • @types/node ^20.11.25
  • @typescript-eslint/eslint-plugin ^7.1.1
  • @typescript-eslint/parser ^7.1.1
  • autoprefixer ^10.4.18
  • eslint ^8.57.0
  • eslint-config-prettier ^9.1.0
  • eslint-plugin-import ^2.29.1
  • path ^0.12.7
  • pmtiles ^3.0.5
  • postcss ^8.4.35
  • postcss-cli ^11.0.0
  • prettier ^3.2.5
  • sass ^1.71.1
  • sass-loader ^14.1.1
  • typescript ^5.4.2
  • vite ^5.1.5
sites/demo/package.json
  • highlight.js 11.9.0
  • @skeletonlabs/skeleton 2.9.2
  • @skeletonlabs/tw-plugin 0.4.0
  • @sveltejs/adapter-auto ^3.0.0
  • @sveltejs/kit ^2.0.0
  • @sveltejs/vite-plugin-svelte ^3.0.0
  • @tailwindcss/forms 0.5.7
  • @tailwindcss/typography 0.5.13
  • @types/eslint ^8.56.0
  • @types/mapbox-gl ^3.1.0
  • @types/node 20.12.8
  • @typescript-eslint/eslint-plugin ^7.0.0
  • @typescript-eslint/parser ^7.0.0
  • autoprefixer 10.4.19
  • eslint ^8.56.0
  • eslint-config-prettier ^9.1.0
  • eslint-plugin-svelte ^2.35.1
  • mapbox-gl ^3.2.0
  • maplibre-gl ^4.1.0
  • pmtiles ^3.0.5
  • postcss 8.4.38
  • prettier ^3.1.1
  • prettier-plugin-svelte ^3.1.2
  • svelte ^4.2.7
  • svelte-check ^3.6.0
  • tailwindcss 3.4.3
  • tslib ^2.4.1
  • typescript ^5.0.0
  • vite ^5.0.3
  • vite-plugin-tailwind-purgecss 0.3.3

  • Check this box to trigger a request for Renovate to run again on this repository

Export Icon SVG fill Color doesn't match the fill color of other MapLibre control icons.

Describe the bug
While other MapLibre controls use #333 as their fill color, the icon in this package has fill color #000. To me, this is a very noticeable difference.

Expected behavior
Matching colors, with the export control following the conventions of the default MapLibre controls.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Firefox (issue exists on chromium as well)

ESLint didn't fix all typescript files in lib directory

Describe the bug

ESLint didn't fix all typescript files in lib directory.

"lint": "eslint lib/**/*.ts",
"lint:fix": "eslint --fix lib/**/*.ts",

These files are not fixed by ESLint:

  • crosshair-manager.ts
  • export-control.ts
  • index.ts
  • map-generator.ts
  • printable-area-manager.ts

To Reproduce
Steps to reproduce the behavior:

  1. Open this project with VSCode.
  2. Run yarn install in terminal.
  3. After running yarn run lint:fix, nothing happens. The format of the files above is not updated.

Expected behavior

All typescript files should be fixed by ESLint.

Screenshots

Screenshot

Additional context

Updating the command to the following will solve the problem.

"lint": "eslint lib/*.ts",
"lint:fix": "eslint --fix lib/*.ts",

ReferenceError: Size is not defined

Hi!
Describe the bug
I would like to try this, but get this error message: "ReferenceError: Size is not defined" . The debugger writes that the error is at line 27 ( PageSize: Size.A3,)

The example code is from the readme.md file. I also tried with the newest version of maplibre-gl (3.1.0), but got the same error.

To Reproduce
Steps to reproduce the behavior:
My full code:

`<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Map</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" rel="stylesheet" />
<link href='https://www.unpkg.com/@watergis/[email protected]/dist/maplibre-gl-export.css' rel='stylesheet' />
<script src="https://www.unpkg.com/@watergis/[email protected]/dist/maplibre-gl-export.umd.js"></script>
<style>
	body { margin: 0; padding: 0; }
	#map { position: absolute; top: 0; bottom: 0; width: 100%; }
</style>
</head>
<body>
<div id="map"></div>
 <script>
var map = new maplibregl.Map({
container: 'map', // container id
style:
'https://api.maptiler.com/maps/streets/style.json?key=xxxxxx',
center: [-96, 37.8],
zoom: 3
});
  map.addControl(new MaplibreExportControl({
      PageSize: Size.A3,
      PageOrientation: PageOrientation.Portrait,
      Format: Format.PNG,
      DPI: DPI[96],
      Crosshair: true,
      PrintableArea: true,
      Local: 'en'
  }), 'top-right');

 </script>
</body>
</html>`

PDF export for A3 size produces incorrect crop

Describe the bug
PDF export for A3 size produces incorrect crop

To Reproduce
Steps to reproduce the behavior:

  1. Click on 'Print icon'
  2. Select 'Page size' 'A3'
  3. Select 'Format' 'Landscape'
  4. Pan and zoom desired area

Expected behavior
Selected area is exported as selected

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

No icons or images are output

Describe the bug
No icons or images are output.

error :
Image "***" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.

To Reproduce
Use LoadImage() and addImage()

Expected behavior
Icon or image is output.

Desktop (please complete the following information):

  • OS: Windows10
  • Browser Google Chrome
  • Version latest

Spanish translation

First of all, congratulations on your plugin because it is amazing.
I think it might be useful for the plugin to have a local Spanish translation,
so I would like to make that contribution, would that be possible?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.