-
Notifications
You must be signed in to change notification settings - Fork 5
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
Google maps example #1
Google maps example #1
Conversation
|
This pull request has been linked to Shortcut Story #361050: Basemaps basic hello world. |
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.
Almost there!
google-basemap/index.ts
Outdated
const satelliteButton = document.getElementById('satellite'); | ||
const hybridButton = document.getElementById('hybrid'); | ||
|
||
roadmapButton?.addEventListener('click', () => { |
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.
How about using a map-type-id
attribute at the button element to avoid repeating
...
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.
I'm also missing the other CARTO basemaps (positron, dark-matter, and voyager). Those are our versions of the basemaps for Google Maps.
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.
@alasarr These are the CARTO basemaps mapsID for Google maps to set by map.setMapTypeId('ID')
?
google-basemap/index.ts
Outdated
const GOOGLE_MAP_ID = import.meta.env.VITE_GOOGLE_MAP_IDS; | ||
const apiBaseUrl = import.meta.env.VITE_API_BASE_URL; | ||
const accessToken = import.meta.env.VITE_API_ACCESS_TOKEN; | ||
const connectionName = import.meta.env.VITE_API_CONNECTION_NAME; |
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.
Remove this, we will add another PR to include connectionName in all the examples
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.
Do I change it in the .env like this?
VITE_API_CONNECTION_NAME= # TODO, will be add another PR to include connectionName in all the examples
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.
Just remove the connection name in this example and open another PR to include the connection name in all the examples
…ture/menusal/sc-361050/basemaps-basic-hello-world
Description
Replicate the following example: codesandbox in Google Maps
Bonus: add a slider control to filter by population
Interactivity as hover is required to show the name + pop
Shorcut: sc-361050
CHECKLIST
TODO