setText method

Popup setText(
  1. String text
)

Sets the popup's content to a string of text.

This function creates a Text node in the DOM, so it cannot insert raw HTML. Use this method for security against XSS if the popup content is user-provided.

@param text Textual content for the popup. @returns {Popup} this @example var popup = new mapboxgl.Popup() .setLngLat(e.lngLat) .setText('Hello, world!') .addTo(map);

Implementation

Popup setText(String text) => Popup.fromJsObject(jsObject.setText(text));