Skip to content

Commit

Permalink
Document map.on_click and map.no_clustering
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarfonts committed Apr 11, 2017
1 parent b80e122 commit 3b8b454
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/ca/widgets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,15 @@ Els paràmetres "url" i "options" es corresponen amb els paràmetres del `constr
Un altre paràmetre opcional és "max_initial_zoom": Indica el nivell de zoom màxim a utilitzar en la vista inicial del mapa.
Això evita acostar-se massa i perdre context cartogràfic, especialment útil quan es mostra una única feature puntual.

Quan hi ha molts marcadors sobre el mapa, s'aplica automàticament una funció d'agrupació dels mateixos (clustering). Si no
es vol aplicar aquest clustering de forma automàtica, cal posar a `true` el paràmetre opcional "no_clustering".

Si s'està utilitzant el widget amb Javascript, és possible capturar el "click" sobre els marcadors i obtenir-ne els detalls::

"on_click": function(marker) {
console.log(marker.feature);
}

Finalment, els paràmetres opcionals habituals "footnote" i "custom_css_url" també estan disponibles.

Vegeu un **exemple funcional complet** aquí: http://bl.ocks.org/oscarfonts/265d734349396cf4372c
Expand Down
9 changes: 9 additions & 0 deletions doc/en/widgets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ The "url" and "options" parameters correspond to `Leaflet's TileLayer.WMS <http:
Another optional input is "max_initial_zoom": It indicates the maximum zoom level to use when the map is
first rendered. This avoids to zoom in too much, so we loose context, especially when a single point feature is drawn.

When there is a risk of marker overlapping on the map, a clustering mechanism is applied automatically.
This automatic clustering can be disabled setting to `true` the optional "no_clustering" parameter.

If creating the widget with Javascript, it is possible to capture the "click" event on a map marker and get its details::

"on_click": function(marker) {
console.log(marker.feature);
}

Finally, the common "footnote" and "custom_css_url" inputs are also available.

See a **complete live example** here: http://bl.ocks.org/oscarfonts/265d734349396cf4372c
Expand Down
10 changes: 10 additions & 0 deletions doc/es/widgets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ Los parámetros "url" y "options" se corresponden con los parámetros del `const
Otro parámetro opcional es "max_initial_zoom": Indica el nivel de zoom máximo a utilizar en la vista inicial del mapa.
Esto evita acercarse demasiado y perder contexto cartográfico, especialmente cuando se muestra una única feature puntual.

Cuando existen muchos marcadores sobre el mapa, se aplica automáticamente una función de agrupación de los mismos (clustering).
Si no se quiere aplicar el clustering de forma automática, debe ponerse a `true` el parámetro opcional "no_clustering".

Si se está usando el widget con Javascript, es posible capturar el "click" sobre los marcadores y obtener sus detalles::

"on_click": function(marker) {
console.log(marker.feature);
}


Por último, los parámetros opcionales habituales "footnote" y "custom_css_url" también están disponibles.

Véase un **ejemplo funcional completo** aquí: http://bl.ocks.org/oscarfonts/265d734349396cf4372c
Expand Down

0 comments on commit 3b8b454

Please sign in to comment.