我在我的网站上有一个带有google places的amp-iframe,问题是它有时会渲染,有时不会。
例如,在这个URL中,它呈现https://www.didomenicapalermo.com.ar/venta/casas/modernas-en-barrio-el-cazador-escobar/amp
<amp-iframe width="600" height="400" layout="responsive" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation" frameborder="0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyD6dkHc8fW_mUsoWRH7XZoje20cAfLqpjw&q= -34.30814559434459,-58.7645224110413&zoom=15"></amp-iframe>但是在thoose URL中它不是https://www.didomenicapalermo.com.ar/venta/terrenos/y-lotes-en-esquina-comercial-de-escobar-zona-norte/amp
<amp-iframe width="600" height="400" layout="responsive" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation" frameborder="0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyD6dkHc8fW_mUsoWRH7XZoje20cAfLqpjw&q=-34.340968537270385,-58.78817459781499&zoom=15"></amp-iframe>https://www.didomenicapalermo.com.ar/venta/terrenos/con-todos-los-servicios-escobar/amp
<amp-iframe width="600" height="400" layout="responsive" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation" frameborder="0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyD6dkHc8fW_mUsoWRH7XZoje20cAfLqpjw&q=-34.33815254252059,-58.797808417633064&zoom=15"></amp-iframe>https://www.didomenicapalermo.com.ar/venta/terrenos/con-agua-corriente-cloacas-escobar/amp
<amp-iframe width="600" height="400" layout="responsive" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation" frameborder="0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyD6dkHc8fW_mUsoWRH7XZoje20cAfLqpjw&q=-34.343364984291966,-58.78496684381105&zoom=15"></amp-iframe>仔细检查了代码,似乎对我来说还可以,但在一些URL中还是失败了。
PS:没有600px错误!
发布于 2019-12-18 18:50:10
您的问题是在Google Map未呈现的页面中缺少amp-iframe。
添加amp-iframe
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js">
</script>此外,您的AMP页面是无效的。您可以验证AMP pages here
https://stackoverflow.com/questions/59378242
复制相似问题