Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(feed): setting zoom level when location not provided #1398

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/components/socialFeed/Map/Map.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ export const Map: FC<MapProps> = ({
center={
consultedPostLocation || creatingPostLocation || DEFAULT_MAP_POSITION
}
zoom={12}
zoom={!consultedPostLocation && !creatingPostLocation ? 2 : 12}
WaDadidou marked this conversation as resolved.
Show resolved Hide resolved
attributionControl={false}
minZoom={2}
WaDadidou marked this conversation as resolved.
Show resolved Hide resolved
>
{/*----Loads and displays tiles on the map*/}
<TileLayer noWrap attribution="" url={MAP_LAYER_URL} />
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/feed/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { CustomLatLngExpression, PostCategory } from "@/utils/types/feed";

export const MAP_LAYER_URL = `https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png?access-token=${process.env.EXPO_PUBLIC_LEAFLET_MAP_TOKEN}`;

// Paris baguette
export const DEFAULT_MAP_POSITION: CustomLatLngExpression = [48.8566, 2.3522];
// center of the map
export const DEFAULT_MAP_POSITION: CustomLatLngExpression = [0, 0];

const musicPostSvgString = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_di_22136_173395)">
Expand Down
Loading