rowanwins / leaflet-easyPrint

A leaflet plugin which adds an icon to print the map - Demo @ http://rowanwins.github.io/leaflet-easyPrint/
MIT License
248 stars 137 forks source link

New output modes #92

Open alfredott opened 5 years ago

alfredott commented 5 years ago

Hi !

This PR adds the possibility to switch between more than 2 output modes, and to use the image in the JS code.

It solves the following issues : https://github.com/rowanwins/leaflet-easyPrint/issues/77, https://github.com/rowanwins/leaflet-easyPrint/issues/68, https://github.com/rowanwins/leaflet-easyPrint/issues/91, and any other issue that can be solved by getting the image from the JS code.

  Technically : First thing, I'm adding the "outputMode" setting (string), instead of "exportOnly" (boolean), because the latter only gave us 2 choices (download/print). To do the same as before, we only have to do the following changes :

Second thing, I'm adding the 'event' option for the "outputMode" setting, so that we can get the image from anywhere in the JS code.

I also changed the Readme to be up to date with the new "outputMode" option.

I hope this PR can be accepted, feel free to tell me if you think I have to make some adjustments.

Bye !

alfredott commented 5 years ago

I've just updated some references to the old setting (exportOnly) I hadn't seen previously.

alfredott commented 5 years ago

Hello, have you been able to read my PR ?

micahwilhelm commented 4 years ago

Hi @alfredott since the PR isn't happening would you be able to integrate your changes into the bundle.js of your fork, please? I'm not sure to do it myself so I can use your cool new output modes!

alfredott commented 3 years ago

Oops, I didn't get a notification for your answer @micahwilhelm Hello ! I don't know if you're still interested in this feature (after 7 months, oof!), but I've just pushed the effects of my changes to bundle.js and bundle.js.map files. Actually, I just ran npm run build and added these changes into the PR.

I'm not quite sure I had the right rollup version to do so, but I guess it will be ok.

I was actually directly using the index.js file (2 years ago), so I hadn't thought of updating bundle.js* files. Thanks for the idea.

I hope it helps someone, bye !