-
Notifications
You must be signed in to change notification settings - Fork 226
Open
Description
hi,
I make an underground parking map by geoserver. And I load the map through change the MAP_STYLE. I want to click the map and get the parking space information from map.
I see that streetscape.gl use the react-map-gl to load map. In module of components/log-viewer/core-3d-viewer.js, the load event of StaticMap can get the map instance of mapbox. So I register mapbox's own event in here. Just like this:
_onMapLoad = evt => {
const map = evt.target;
map.on('click', function (e) {
console.log("mapbox click");
});
map.on('click', 'newpark', function (e) {
console.log("mapbox layer click");
});
this.props.onMapLoad(map);
};
Howerver It doesn't work!
Is there any way to listen to mapbox's own event in streetscape.gl
Activity
twojtasz commentedon Aug 12, 2019
@Pessimistress any suggestions?
Pessimistress commentedon Aug 12, 2019
We disable pointer interaction on the map. You can do something like
Questionboy commentedon Aug 13, 2019
Thank you for your reply. As you say, I change the StaticMap to InteractiveMap and try to add the onClick event in InteractiveMap. However, I cann't get any return from onClick event in InteractiveMap. It must be intercept by the click event in deck.gl.
JianXinyu commentedon Dec 23, 2021
Hi, did you solve this in the end? I have the same problems now. Thanks!