Skip to content

Commit

Permalink
Ajoute le composant MapboxMapStatic
Browse files Browse the repository at this point in the history
  • Loading branch information
KeziahMoselle committed Mar 6, 2024
1 parent b0a0917 commit e581fd7
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions packages/ui/molecules/Mapbox/MapboxMapStatic.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{#
/**
* @file
* MapboxMapStatic component.
*
* @param array $attr
* Use it to customize the root element attributes.
* @param string $username
* The username of the account to which the style belongs.
* @param string $style_id
* The ID of the style from which to create a static map.
* @param string $overlay
* see https://docs.mapbox.com/api/maps/static-images/#overlay-options
* @param number $lon
* Longitude for the center point of the static map; a number between -180 and 180.
* @param number $lat
* Latitude for the center point of the static map; a number between -85.0511 and 85.0511.
* @param number $zoom
* Zoom level; a number between 0 and 22. Fractional zoom levels will be rounded to two decimal places.
* @param number $bbox
* Four coordinates representing upper longitude, upper latitude, lower longitude, lower latitude, enclosed in square brackets like [lon(min),lat(min),lon(max),lat(max)].
* @param number $width
* Width of the image; a number between 1 and 1280 pixels.
* @param number $height
* Height of the image; a number between 1 and 1280 pixels.
*
* - Optional parameters
*
* @param number $bearing
* Rotation, between 0 and 360
* @param number $pitch
* Pitch tilts the map, between 0 and 60
* @param string $@2x
* Renders at @2x scale, default: true
* @param boolean $attribution
* Whether there is attribution on the image, if false read: https://docs.mapbox.com/help/getting-started/attribution/#static--print, default: true
* @param boolean $logo
* Whether there is a Mapbox logo, defaults: true
*
*/
#}

{# Root attributes #}
{% set attributes = merge_html_attributes(attr ?? null, {
src: 'https://api.mapbox.com/styles/v1/mapbox/streets-v12/static/pin-l+555555(9.4088,40.825)/2.9445,46.4726,2.23,0/500x500@2x?before_layer=block-number-label&access_token=pk.eyJ1IjoiYWdlbmNlc3R1ZGlvbWV0YSIsImEiOiJjanh5ZW81aHEwOHV3M2lwZzhhNW1vdXl5In0.3hbV2QKVzZWf511JK9xCug',
alt: '',
}) %}

<img {{ html_attributes(attributes) }} />

0 comments on commit e581fd7

Please sign in to comment.