Closed chrisdrackett closed 5 years ago
@chrisdrackett
how are planing of exposing the different events handlers?
Invoke
<MapKit regionChangeStartEventHandler={(event) => console.log("Region Change Started");}
and then adding it to the map on updateMapProps
?
if (this.props.regionChangeStartEvent) {
this.map.addEventListener("region-change-start", this.props.regionChangeStartEvent);
}
yeah, I think this is probably the best way to go. I was thinking of using language along the lines of onRegionChangeStart
to fit with other events in react.
I'm redoing this as a hook that provides the map object directly. This way users can use the map to add or remove event listeners themselves.
https://developer.apple.com/documentation/mapkitjs/mapkit/map/handling_map_events