-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
tooltip hover extrusions #7772
Comments
@KravMaguy can you make a test case of what you're trying to do, in a jsfiddle? |
@peterqliu |
@KravMaguy The functionality that makes this possible was just merged into What you're looking for is a combination of these two examples: |
@KravMaguy You'll also need to update the popup position as the mouse moves, in order to track it to the cursor. https://www.mapbox.com/mapbox-gl-js/example/mouse-position/ gets you the coordinate which you can use for |
Thank you peter, and Mapbox, If exists, refer me to documentation that shows how I can give these points a height property, as not all units for rent will be on ground level. |
Yes, and thank you peter, |
You'll need to stack multiple extrusions. Basically each floor will be its own fill-extrusion layer. You can use the |
Thank you ryan, Imagine an apartment building in NYC, or an office building, this building has many floors, each floor has its own individual apartments or offices, you want to display information to the user about the individual apartment/office/whatever for rent, you can do this when the user hovers over it, or when he clicks, doesnt really matter, this is the best way I can explain what I am trying to do. This issue is not really closed. Can you please re-open it? |
If I'm understanding your issue correctly, I believe that ray picking will allow what you're trying to accomplish. If you have an extruded building built up out of a stack of individual layers, then you can track the mouse position, call |
Yes that is exactly what I want to do, I have to wait two weeks to do it? (Implement it in my app) |
No, it's in the |
Gentlemen, |
You have to remove the |
Please see my setup and what I am doing wrong? |
This command |
Emailed support about this question yesterday:
How to get a tooltip hover over fill extrusion?
example where a hover tooltip follows the mouse on enter:
https://imgur.com/a6qjmlA
mapbox-gl-js version:
https://www.mapbox.com/mapbox-gl-js/example/3d-extrusion-floorplan/
Question
I took the following code from your example:
https://www.mapbox.com/mapbox-gl-js/example/popup-on-hover/
` map.on('mouseenter', 'places', function(e) {
// Change the cursor style as a UI indicator.
map.getCanvas().style.cursor = 'pointer';
I replaced it with the following code:
` map.on('mouseenter', 'room-extrusion', function(e) {
// Change the cursor style as a UI indicator.
map.getCanvas().style.cursor = 'pointer';
Something is working correctly but I dont get the tooltip on hover I am receiving the following errors in the console when I do hover over an extrusion:
https://imgur.com/FLM1pho
Its telling me
LngLatLike
arguement must be an instance, object or array.Links to related documentation
https://www.mapbox.com/mapbox-gl-js/api/#lnglatlike
How do I fix this and have the tooltip appear on hover over extrusions? as well I wanted to understand the difference in your example
https://www.mapbox.com/mapbox-gl-js/example/popup-on-hover/
where the tooltip only appears @ a specific point, and something like this:
http://jsfiddle.net/q46Xz/187/
Where the tooltip follows the mouse when it enters the div, and how I can do this with an extrusion.
The text was updated successfully, but these errors were encountered: