How do I change the default cursor in leaflet maps?

前端 未结 6 2023
独厮守ぢ
独厮守ぢ 2020-12-14 17:02

I am trying to modify the default cursor icon when a certain control button is pressed. Although I was partially successful by using css on the container div, doing this ove

6条回答
  •  被撕碎了的回忆
    2020-12-14 17:47

    Leaflet's styles allow you to change some cursor behavior. Put these in your local CSS to make the change.

    /* Change cursor when mousing over clickable layer */
    .leaflet-clickable {
      cursor: crosshair !important;
    }
    /* Change cursor when over entire map */
    .leaflet-container {
      cursor: help !important;
    }
    

提交回复
热议问题