Skip to content

Commit

Permalink
✨ make map style
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannLai committed Jan 30, 2024
1 parent 5f84620 commit 229030d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/showPoisOnMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function createShowPoisOnMap({
Displays specific Points of Interest (POIs) on a map using the Mapbox Static API. Returns a URL to the map image.
pois: An array of POIs to be displayed on the map.
zoom: The zoom level for the map depends from the place size. For larger places use min value and for smaller use max. For countries use zoom '1.0'-'3.0'; for national parks, states use '4.0'-'6.0'; landmarks, places or cities use '7.0'-'9.0'. For streets use '15'. If multiple places are provided, this will automatically set to 'auto'.
mapStyle: The style of the map. Can be 'streets-v12' or 'satellite-streets-v12'.
mapStyle: The style of the map. Can be 'streets-v12', 'satellite-streets-v12', or 'outdoors-v12'. Default please set 'outdoors-v12'.
`

const execute = async ({ pois, zoom, mapStyle }: z.infer<typeof paramsSchema>) => {
Expand All @@ -35,6 +35,10 @@ function createShowPoisOnMap({
throw new Error('Please set the Mapbox Access Token in the plugin settings.');
}

if (!mapStyle) {
mapStyle = 'outdoors-v12';
}

let markers;
let padding = "";
let formatZoom = zoom?.toString() || (pois.length == 1 ? '9' : 'auto'); // Use provided zoom level or default
Expand Down

0 comments on commit 229030d

Please sign in to comment.