-
Notifications
You must be signed in to change notification settings - Fork 12
Use Case: Static maps #17
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
Comments
This is typically achieved in existing frameworks by not adding pan and zoom controls to the map. These controls are often added by default to the map and have to be actively disabled. The mechanic in use then is not that the map is "frozen", just that the map has an initial location and zoom level, and the user has no way to change those if no pan or zoom controls are offered. |
So its the pan and zoom controls presence that enables drag-to-pan, for
example?
…On Thu, Apr 25, 2019, 1:57 PM Chris Hodgson ***@***.***> wrote:
This is typically achieved in existing frameworks by not adding pan and
zoom controls to the map. These controls are often added by default to the
map and have to be actively disabled. The mechanic in use then is not that
the map is "frozen", just that the map has an initial location and zoom
level, and the user has no way to change those if no pan or zoom controls
are offered.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASTBJIRL4UFXL6UJTXVT3LPSHWHZANCNFSM4HIPFOAQ>
.
|
It's definitely a good use case & it does mean that we have to think more broadly about what it means to provide default "controls": is the control just the visible buttons, or is it the entire functionality? |
The pan control provides the drag-to-pan functionality. It may or may not also provide (arrow) button-based click-to-pan, that might be a separate control or an option to the pan control. Also touch-based drag-to-pan uses different events and sometimes requires different handling or to be separately enabled/disabled (depending on how you want the map to behave on touch-based devices). |
OK, well I was thinking about controls being on/off in a similar way to how the |
Ok after reviewing some API docs, I guess it was way back in Openlayers 2 that pan was a control. In the current Openlayers, DragPan is an "interaction" which seems to be anything that receives events from the map and causes things to happen on the map as a result. In Leaflet controls are generally things that put buttons on the map interface. Drag-panning in Leaflet is just an option to the map. |
I think the video element controls attribute is a reasonable parallel, just consider how much more complex a map is than a video, and the level of custom interaction that existing map frameworks provide APIs for, and you can see that you need more than a single on/off switch for all controls. |
I think you're right, and the HTMLMediaElement interface may show us the way that is done for video/audio. If not we may need to invent :-) |
So, getting back to the topic of this issue, which is, the HTML / map author needs a way to enable a static map, or conversely, disable/make static a slippy map, while still retaining some mappyness. |
This comment has been minimized.
This comment has been minimized.
@nchan0154, @NickFitz |
@Malvoz I've got static maps on my to do list, if nobody beats me to it. Thanks for the links, they're very helpful. |
Thank you @Malvoz! I think I can update the capabilities section on this as I missed a couple when looking for them the first time round. |
These APIs are useful. They seem to share a desire to make it simple to include an actual map, possibly composed of fused tiles, as the value of That is author simplicity. User simplicity, or constrained use of a map by making it 'static', but still a map (as opposed to purely an image), is also a goal (of this issue). |
A technical note for future reference: the Google API key I'm using is tied to the examples/ path, but in Safari (and I presume other browsers) the default referrer policy for images is to only send the root domain in the Referer: header. I've therefore added https://localhost:8000/ and https://maps4html.github.io/ as permitted referrers for that API key, and will do the same for the other keys I have control of. (N.B. no '*' after the URL - it seems that makes Google, at least, require a path component in the Referer: header.) @AmeliaBR Could you do the same for the MapBox API key if necessary, please? Oh, and I've realised that I accidentally overwrote the project MapBox key with my own in a recent PR, so |
Thanks. Pretty sure I just set domains without paths in the permissions for that key, so it should be fine now. |
Yes, it is definitely worth distinguishing the two different ways of getting a static map image (as For our purposes, the However, it's definitely still worth talking about the fact that many of these map data services provide static images, because that shows that there is a demand for static map snapshots. |
This issue is for discussion of the use case “Display a region of map data as a static image”, its examples & list of required capabilities.
Ironically, sometimes an HTML author wants to provide a simple static map that provides some other mappiness (a pushpin or two, for example). It would be good to be able to 'freeze' a map at a location, perhaps using a CSS property, or possibly, though not preferably, an attribute. Being a map, it would still be "georeferenced" for crawlers' sake only, perhaps. But it could use back-end services like WMS or tile caches to provide visual and non-visual semantic context.
The text was updated successfully, but these errors were encountered: