mirror of
https://github.com/maputnik/editor.git
synced 2026-07-26 15:57:27 +00:00
Indicate if feature is clickable
This commit is contained in:
@@ -89,7 +89,11 @@ export default class InspectionMap extends React.Component {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
map.on('click', this.displayPopup.bind(this));
|
map.on('click', this.displayPopup.bind(this))
|
||||||
|
map.on('mousemove', function(e) {
|
||||||
|
var features = map.queryRenderedFeatures(e.point, { layers: this.layers })
|
||||||
|
map.getCanvas().style.cursor = (features.length) ? 'pointer' : ''
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
displayPopup(e) {
|
displayPopup(e) {
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ export default class MapboxGlMap extends React.Component {
|
|||||||
})
|
})
|
||||||
|
|
||||||
map.on('click', this.displayPopup.bind(this));
|
map.on('click', this.displayPopup.bind(this));
|
||||||
|
map.on('mousemove', function(e) {
|
||||||
|
var features = map.queryRenderedFeatures(e.point, { layers: this.layers })
|
||||||
|
map.getCanvas().style.cursor = (features.length) ? 'pointer' : ''
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
displayPopup(e) {
|
displayPopup(e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user