A
A
Anastasia2020-11-02 09:56:55
leaflet
Anastasia, 2020-11-02 09:56:55

How to change hover text of Control from react-leaflet-control?

It is necessary to change the language for displaying tooltips on hover (in the markup, Control turns into a tag with a title, which needs to be changed), tell me, can this be specified somewhere in the passed parameters?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2020-11-02
@KnopkaNen

In the source it looks like this

var Zoom = Control.extend({
  	// @section
  	// @aka Control.Zoom options
  	options: {
  		position: 'topleft',

  		// @option zoomInText: String = '+'
  		// The text set on the 'zoom in' button.
  		zoomInText: '+',

  		// @option zoomInTitle: String = 'Zoom in'
  		// The title set on the 'zoom in' button.
  		zoomInTitle: 'Zoom in',

  		// @option zoomOutText: String = '−'
  		// The text set on the 'zoom out' button.
  		zoomOutText: '−',

  		// @option zoomOutTitle: String = 'Zoom out'
  		// The title set on the 'zoom out' button.
  		zoomOutTitle: 'Zoom out'
  	},
   ...
}

So it's enough to pass in the optionappropriate keys.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question