-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add prompt for multi-export scale AND/OR allow setting this in DistortableCollection constructor #471
Comments
@jywarren I think that was why we held off on docs for the exporter - we were still thinking about how we could make the function customizable without having to re-write the whole action like we did in MK. because we don't have any API for passing options to actions. So we would need to build that. Also the prompt is really good idea. The prompt could be a GCI issue? The API for passing options to actions would probably be more of a longer consistent effort than a typical GCI task but could be a hall of fame? |
Yeah this could probably be a GCI issue! I think it's necessary to publish the new MapKnitter version, because with scale pegged to 100 px per cm, if you are mapping a large area like a city block, maps are HUGE files (15000 x 15000 px) and if you're mapping a small area like a garden, they're tiny... 300x300px. Example of huge -- our exporter can handle this, which the legacy exporter cannot! This is about 15000x8000px: http://mapknitter-exports-warps.storage.googleapis.com/1575518821/1575518821.jpg So, we should set it to 100 by default but let people modify it. Later, we should make a rough calculation -- can we get the bounds of the collection? If so, we could do a rough suggested calculation to offer an initial export scale that generates a roughly 1000x1000px image. Note above it says But let's just get the basic prompt working first! Could we just literally modify that line: opts.scale = opts.scale || 100; // switch it to _getAvgCmPerPixel ! so instead of That'd be a great initial step; later we can offer an override. |
Done in #478! |
This seems to indicate we can set the scale in options:
Leaflet.DistortableImage/src/edit/DistortableCollection.Edit.js
Lines 194 to 198 in 6e4b078
But we don't actually use that, here:
Leaflet.DistortableImage/src/edit/actions/ExportAction.js
Line 32 in 22cf322
Can we make it possible to set the scale dynamically, either by opening a prompt (what if we said scale defaults to a prompt instead of 100?) or by allowing people to pass a function to determine the scale, as a DistortableCollection constructor option? cc @sashadev-sky what do you think?
The text was updated successfully, but these errors were encountered: