Embed Map with Marker on AMP HTML page

前端 未结 3 2516
小鲜肉
小鲜肉 2021-02-20 17:33

Currently I use the Google Maps API to generate a map with a marker (given a lat/long set of coordinates) to a given location. In AMP HTML, it appears the way to do this current

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-20 18:17

    The trick is to not use the "view" mode, but rather the "place" mode. With the place mode, you don't need a place ID, you can simply use coordinates. As an example:

    
    
    

    As an additional note, if you are using this with AMP, I recommend you include a placeholder image in case the iframe is too close to the top of the page (an AMP rule). In that case, I might use an , like so:

    
    

    within the iframe, so that it has the following format:

    
        
    
    

提交回复
热议问题