Automattic / Automattic/jetpack
AMP map block doesn't work on non-SSL sites, and throws incorrect errors
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
Basically, the issue here is that `` requires that `src=` be an https URL.
However, with our current implementation, the map's `amp-iframe` URL points to the origin (in fact, it only does this for AMP - the native version loads the map in a div and renders on a canvas)
What our implementation _should_ do is render an iframe that points directly to MapBox's iframe rendering endpoint, or even one of our own, that simply takes the marker locations and other configuration info as URL parameters.
#### Steps to reproduce the issue
1. On a site without SSL, and with AMP standard mode...
2. Add a map block
3. View the page
#### What I expected
A map
#### What happened instead
No map - nor even a map-like placeholder. Though it does warn in the editor that http is not a valid protocol for amp-iframe in the editor.
Contributor guide
Research direction
Start with the AMP map block and trace how its amp-iframe URL is constructed; compare this with the native version's div and canvas rendering path. Reproduce the issue on a non-SSL site in AMP standard mode, then verify that the map renders without the invalid-protocol warning or related errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100