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

Add center prop and logic around it #436

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
379f113
update: npm i
matbmapspeople Jan 8, 2025
2e2a7ec
chore: add center to webcomponent.js
matbmapspeople Jan 8, 2025
fa47955
add: define center atom
matbmapspeople Jan 8, 2025
087d8d3
chore: create a setter inside MapTemplate.jsx
matbmapspeople Jan 8, 2025
2f21963
add: center to MapsIndoorsMap
matbmapspeople Jan 8, 2025
2d254d2
chore: improve determineMapBounds function so it respects center prop
matbmapspeople Jan 9, 2025
95e57bb
fix: lerna error
matbmapspeople Jan 9, 2025
4324c6f
fix: jsdocs
matbmapspeople Jan 9, 2025
3dc341b
fix: use promise and fix naming
matbmapspeople Jan 9, 2025
ef705ff
Update packages/map-template/src/components/MapTemplate/MapTemplate.jsx
matbmapspeople Jan 10, 2025
cd15493
fix: runtime changes and zoom level
matbmapspeople Jan 10, 2025
76ca32c
fix: null padding values
matbmapspeople Jan 10, 2025
c75eb49
chore: improve JSDocs
matbmapspeople Jan 14, 2025
1858817
chore: use recoilstate and move intersecting point later in the code
matbmapspeople Jan 14, 2025
53f3d97
chore: apply suggestions
matbmapspeople Jan 17, 2025
bc9ddee
Merge branch 'main' into feature/create_center_url_param_and_logic
matbmapspeople Jan 17, 2025
a3a1df2
chore: create a helper function for getting centerPoint
matbmapspeople Jan 17, 2025
dcfa83f
chore: improve jsdocs
matbmapspeople Jan 20, 2025
c35b413
chore: use better naming for zoomLevel
matbmapspeople Jan 20, 2025
e92cf4e
chore: improve JSDocs for center prop
matbmapspeople Jan 20, 2025
c2ea6f5
add: helper function to get a proper zoom level
matbmapspeople Jan 20, 2025
67d42c6
check if menuInfo?.mainmenu exists
matbmapspeople Jan 20, 2025
b09d40c
fix: weird padding when no props are applied
matbmapspeople Jan 22, 2025
e114fc3
chore: clean up
matbmapspeople Jan 22, 2025
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
Prev Previous commit
Next Next commit
chore: create a setter inside MapTemplate.jsx
matbmapspeople committed Jan 8, 2025
commit 087d8d3f9bd48fa53f088a1808698a9d566cdad9
12 changes: 11 additions & 1 deletion packages/map-template/src/components/MapTemplate/MapTemplate.jsx
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ import showExternalIDsState from '../../atoms/showExternalIDsState.js'
import showRoadNamesState from '../../atoms/showRoadNamesState.js';
import searchExternalLocationsState from '../../atoms/searchExternalLocationsState.js';
import isNullOrUndefined from '../../helpers/isNullOrUndefined.js';
import centerState from '../../atoms/centerState.js';

// Define the Custom Elements from our components package.
defineCustomElements();
@@ -92,8 +93,9 @@ defineCustomElements();
* @param {boolean} [props.showRoadNames] - A boolean parameter that dictates whether Mapbox road names should be shown. By default, Mapbox road names are hidden when MapsIndoors data is shown. It is dictated by `mi-transition-level` which default value is 17.
* @param {boolean} [props.showExternalIDs] - Determine whether the location details on the map should have an external ID visible. The default value is set to false.
* @param {boolean} [props.searchExternalLocations] - If you want to perform search for external locations in the Wayfinding mode. If set to true, Mapbox/Google places will be displayed depending on the Map Provider you are using. If set to false, the results returned will only be MapsIndoors results. The default is true.
* @param {string} [props.center] - TODO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs explanation

andreeaceachir142 marked this conversation as resolved.
Show resolved Hide resolved
*/
function MapTemplate({ apiKey, gmApiKey, mapboxAccessToken, venue, locationId, primaryColor, logo, appUserRoles, directionsFrom, directionsTo, externalIDs, tileStyle, startZoomLevel, bearing, pitch, gmMapId, useMapProviderModule, kioskOriginLocationId, language, supportsUrlParameters, useKeyboard, timeout, miTransitionLevel, category, searchAllVenues, hideNonMatches, showRoadNames, showExternalIDs, searchExternalLocations }) {
function MapTemplate({ apiKey, gmApiKey, mapboxAccessToken, venue, locationId, primaryColor, logo, appUserRoles, directionsFrom, directionsTo, externalIDs, tileStyle, startZoomLevel, bearing, pitch, gmMapId, useMapProviderModule, kioskOriginLocationId, language, supportsUrlParameters, useKeyboard, timeout, miTransitionLevel, category, searchAllVenues, hideNonMatches, showRoadNames, showExternalIDs, searchExternalLocations, center }) {

const [, setApiKey] = useRecoilState(apiKeyState);
const [, setGmApiKey] = useRecoilState(gmApiKeyState);
@@ -122,6 +124,7 @@ function MapTemplate({ apiKey, gmApiKey, mapboxAccessToken, venue, locationId, p
const [, setshowExternalIDs] = useRecoilState(showExternalIDsState);
const [, setShowRoadNames] = useRecoilState(showRoadNamesState);
const [, setSearchExternalLocations] = useRecoilState(searchExternalLocationsState);
const [, setCenter] = useRecoilState(centerState);
const [viewModeSwitchVisible, setViewModeSwitchVisible] = useState();

const [showVenueSelector, setShowVenueSelector] = useState(true);
@@ -553,6 +556,13 @@ function MapTemplate({ apiKey, gmApiKey, mapboxAccessToken, venue, locationId, p
setSearchExternalLocations(searchExternalLocations);
}, [searchExternalLocations]);

/*
* TODO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do 😁

*/
andreeaceachir142 marked this conversation as resolved.
Show resolved Hide resolved
useEffect(() => {
setCenter(center);
}, [center]);

/**
* When map position is known while initializing the data,
* set map to be ready.