-
Notifications
You must be signed in to change notification settings - Fork 11
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
RadarMap.fitToMarkers
class method
#156
Conversation
- bump tsconfig target from es2015->es2016 for compatibility with class inheritence
src/ui/RadarMap.ts
Outdated
markers.forEach(marker => { | ||
bounds.extend(marker.getLngLat()); | ||
}); | ||
this.fitBounds(bounds, fitBoundsOptions); |
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.
What does this do if markers is empty? Also what's the deal with the animation options on this, do those need to be specified?
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.
added a no-op if markers is empty. Yeah you can pass in animation options into fitBoundsOptions
https://docs.mapbox.com/mapbox-gl-js/api/map/#map#fitbounds
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 do fitMarkers({animate: false})
to disable animations. it uses map.flyTo
by default
- better handling of default fit to markers options
* Radar map UI kit refactor (#153) * support custom style * custom markers * Maplibre control radar logo * bump version * refactor mapui kit by inheriting maplibre-gl - bump tsconfig target from es2015->es2016 for compatibility with class inheritence * pass request header override in map transformRequest * version bump * include custom style id in marker request * new marker logic * Delete .vscode directory * add .vscode/ to .gitignore * bump version * bump version * update transformRequest and add custom styles to demo page * marker updates * remove `getOptions` from `RadarMarker` * better way to handle custom markers and image urls * add custom url input to marker demo page * compliation target changes and copy changes * set beta version --------- Co-authored-by: Craig Kochis <[email protected]> * `RadarMap.fitToMarkers` class method (#156) * Map initalization `language` param (#161) * fix radar-default-v1 fallback regression * bump version * marker default width and height * bump version * `RadarMarker` popup improvements (#166) * bump version * Support click event on marker instance (#167) * support click handlers on markers * log map click * force popup on click * Update marker params (#168) * update marker params * handle popup.element * bump maplibre version in peer deps (#169) * img alt text * bump version * update dev version of maplibre-gl * fix marker image width and height * remove unused navigator * update browserlist * remove beta tag * support number and string for marker width/height * fix types --------- Co-authored-by: Jason Liu <[email protected]>
NOTE: #153 needs to be reviewed first
single line function to adjust the bounds of a
RadarMap
to fit to allRadarMarker
added to the map.