-
Notifications
You must be signed in to change notification settings - Fork 12
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
Responsive image maps #101
Comments
I saw that someone over there said that
So perhaps transform is a dead end after all, but I think that would solve some of the issues for using maps with media queries and the picture element. |
Oddly, it seems that percentages (which I believe would solve this) were once valid for coordinate values, MDN says:
If that is accurate, I wonder what the reasons were for removing it?
In whatwg/html#389 which you've linked to, there already are suggestions to solve it, but (at the time) a lack of implementor interest. I suppose there'd have to be implementor interest in the MapML/HTML Map Element proposals first before they can count as motivators for changes to the
Just for me to understand - if that had worked, what would the intention going forward be? To spec that browsers must apply transforms to area coords within MapML documents? Or were you just looking into it for perhaps demonstrational purposes? Perhaps there are other CSS hacks to look into then? |
I was hoping to provide a non-scripted responsive fallback for areas in my GeoServer plugin, which serves the web-map polyfill in its HTML Layer Preview response (I am working on a video demonstrating this plugin now, together with the fallback. I'll post a link here when I'm done. It's kind of hard to explain without pictures). There is currently a long-standing plugin for GeoServer which generates a I'm trying to build the case / evidence that today's
No, I hope to not change or make any proposal to change the
Did you have something in mind? I would hack it if I could (without scripting it). |
Using CSS, the only thing I can think of is to override the This would allow for changing the Just an idea. Which might have to get a lot more elaborate than this, and since it's a hack for |
That is very creative! Although not the first time I've heard of clip-path, it is definitely a unique suggestion for its application, to me. I will tinker with it if I can find some time. |
I set up a pretty rough demo from tinkering with it myself, I placed the |
@Malvoz looks interesting, and most importantly, functional. I don't understand it all yet, but from what I see, we would need to generate a top/left % scale for each area for each possible img src. Could get heavy for large sets of I will keep looking at it to understand it better. Thank you for having the interest to do that! |
Oh and if you haven't noticed already, I had left a few explanatory comments in the HTML file for the essential properties that might clarify some of the things. |
@Malvoz, I did notice, and thanks you were right I needed them :-) |
@AmeliaBR this is the issue I mentioned that @Malvoz has been helping me with. Can we discuss here and figure out a recommendation / solution before pitching that over in the WHATWG issue? I was thinking specifically about how to apply a css transform to the area coords would allow us to include "source" coordinates from the GeoServer feature and supply a transform inside a media query that matched the source@media value. Maybe I'll let @Malvoz's code explain itself, but he got it to work with CSS shapes, I think. I couldn't get my example to transform, but I think that is per spec, and I'm not quite sure why. There is an existing GeoServer plugin that will serialize geospatial features as |
@prushforth I've made a small update to the demo page, and included a list of issues with my approach. The HTML/CSS has been simplified to its bare minimum, I think it should be more readable now. |
Thanks! |
This issue may be better raised on the HTML spec itself, but I was hoping we could discuss a bit before that so that I don't get something too badly wrong out of ignorance.
I have been working on implementing MapML support in GeoServer, and it works quite nicely. I was able to include a
<picture>
element with a number of child<source>
elements, allowing the initial view of the map to work whether or not script runs. In doing this, I am able to include a number of links to images that are generated by WMS GetMap requests only on demand (which one is decided by the user agent).I noticed today that someone has long ago created a GeoServer plugin on demand, serializes a GeoServer GetMap request as a
<map>
element with a set of appropriate child<area>
elements. The plugin html response doesn't generate the<img usemap="...">
element, only the<map>
and<area>
s, however, I presume so that the<map>
html document can be server-side included in another HTML response.So I was thinking about how to use this functionality in my
<picture><source><img>
usage above, and I realized that I would have to either specify a different<map>
for each chosen image URL, or I would need to be able to transform the<area coords="...">
values to conform to the chosen image. All of this just can't be done declaratively, as far as I know, and I know that WICG members have asked for responsive image maps before, so was wondering how we might suggest to specify a declarative way to do that, and potentially add it to this repo/spec.Currently, in the web-map custom element 'polyfill', child
<area is="map-area">
elements are progressively enhanced by my code, and the coordinates are transformed into the map projection coordinate system (TCRS), which is nice, but it still doesn't satisfy the above (responsive image maps) non-progressive scenario.Any discussion appreciated.
The text was updated successfully, but these errors were encountered: