diff --git a/src/components/NextMeetup/Place/Icon.js b/src/components/NextMeetup/Place/Icon.js index a84bb445..2790db36 100644 --- a/src/components/NextMeetup/Place/Icon.js +++ b/src/components/NextMeetup/Place/Icon.js @@ -1,6 +1,7 @@ import { withPrefix } from 'gatsby' +import L from 'leaflet' -const iconNantesJS = { +export const iconNantesJS = L.icon({ iconUrl: withPrefix('/images/logotype.png'), iconRetinaUrl: null, iconAnchor: null, @@ -10,6 +11,4 @@ const iconNantesJS = { shadowAnchor: null, iconSize: [50,50], className: 'marker' -} - -export { iconNantesJS } \ No newline at end of file +}) diff --git a/src/components/NextMeetup/Place/Place.js b/src/components/NextMeetup/Place/Place.js index 33c09c6c..fd5103f8 100644 --- a/src/components/NextMeetup/Place/Place.js +++ b/src/components/NextMeetup/Place/Place.js @@ -1,20 +1,19 @@ import React from 'react' -import { number } from 'prop-types' +import { string, number } from 'prop-types' import { FullWidthContainer } from '../../FullWidthContainer' import { MapContainer, Marker, Popup, TileLayer } from 'react-leaflet' import { iconNantesJS } from './Icon' -import L from 'leaflet' import * as styles from './Place.module.css' Place.propTypes = { latitude: number, longitude: number, - name: String, - link: String, - address: String, + name: string, + link: string, + address: string, postal_code: number, - city: String, + city: string, } @@ -28,9 +27,10 @@ export function Place ({ city }) { const GATSBY_MAPBOX_TOKEN = process.env.GATSBY_MAPBOX_TOKEN + if (!latitude || !longitude || !GATSBY_MAPBOX_TOKEN) return null const position = [latitude, longitude] - console.log({position}) + return (
@@ -39,8 +39,8 @@ export function Place ({ zoom={15} className={styles.leaflet_container} scrollWheelZoom={false} - dragging={!L.Browser.mobile} - tap={!L.Browser.mobile}> + dragging={true} + tap={true}>