-
Notifications
You must be signed in to change notification settings - Fork 7
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
matbmapspeople
wants to merge
24
commits into
main
Choose a base branch
from
feature/create_center_url_param_and_logic
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+181
−43
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 2e2a7ec
chore: add center to webcomponent.js
matbmapspeople fa47955
add: define center atom
matbmapspeople 087d8d3
chore: create a setter inside MapTemplate.jsx
matbmapspeople 2f21963
add: center to MapsIndoorsMap
matbmapspeople 2d254d2
chore: improve determineMapBounds function so it respects center prop
matbmapspeople 95e57bb
fix: lerna error
matbmapspeople 4324c6f
fix: jsdocs
matbmapspeople 3dc341b
fix: use promise and fix naming
matbmapspeople ef705ff
Update packages/map-template/src/components/MapTemplate/MapTemplate.jsx
matbmapspeople cd15493
fix: runtime changes and zoom level
matbmapspeople 76ca32c
fix: null padding values
matbmapspeople c75eb49
chore: improve JSDocs
matbmapspeople 1858817
chore: use recoilstate and move intersecting point later in the code
matbmapspeople 53f3d97
chore: apply suggestions
matbmapspeople bc9ddee
Merge branch 'main' into feature/create_center_url_param_and_logic
matbmapspeople a3a1df2
chore: create a helper function for getting centerPoint
matbmapspeople dcfa83f
chore: improve jsdocs
matbmapspeople c35b413
chore: use better naming for zoomLevel
matbmapspeople e92cf4e
chore: improve JSDocs for center prop
matbmapspeople c2ea6f5
add: helper function to get a proper zoom level
matbmapspeople 67d42c6
check if menuInfo?.mainmenu exists
matbmapspeople b09d40c
fix: weird padding when no props are applied
matbmapspeople e114fc3
chore: clean up
matbmapspeople File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: create a setter inside MapTemplate.jsx
commit 087d8d3f9bd48fa53f088a1808698a9d566cdad9
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs explanation