• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

OSMap Markers

OSMap shows the markers of a map model and fires events when a marker is selected or dragged. Based on Leaflet by Volodymyr Agafonkin and OpenStreetMap.

Osmap Tag Documentation

OpenStreetMap component using Leaflet.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Client-side widget variable name.
attribution String false Attribution text for the tile layer.
center String true Center of the map as 'lat,lng'.
draggable boolean false true Whether the map is draggable.
fullScreen boolean false true Whether full screen control is shown.
loadingControl boolean false true Whether loading control is shown.
model MapModel false Map model with markers, polylines, polygons, etc.
onPointClick String false Client-side script to run when a point is clicked.
scrollWheel boolean false true Whether scroll wheel zoom is enabled.
style String false Inline style of the component.
styleClass String false Style class of the component.
tileUrl String false URL template for map tiles.
zoom int true 8 Initial zoom level.
zoomControl boolean false true Whether zoom control is shown.
Tag Documentation Widget Source Basic Markers
Marker usage

Markers are added to the model of the map.

Marker Selection

The overlaySelect event fires when a marker is clicked: click a marker.

Draggable Marker

Markers can be draggable: the markerDrag event fires when a marker is dropped. Drag a marker.

Usage


<style>
    /* the map tiles follow the color scheme of the page (data-dark on html, set by the theme configurator) */
    html[data-dark="true"] .leaflet-tile-pane {
        filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9);
    }
</style>

<div class="card">
    <h5>Marker usage</h5>
    <p>Markers are added to the <code>model</code> of the map.</p>
    <h:form id="formMarkerUsage">
        <pe:osmap style="width:100%; height:500px;"
                  center="36.890257,30.707417"
                  zoom="13" model="#{markersView.simpleModel}"/>
    </h:form>
</div>

<div class="card">
    <h5>Marker Selection</h5>
    <p>The <i>overlaySelect</i> event fires when a marker is clicked: click a marker.</p>
    <h:form id="formMarkerSelection">
        <p:growl id="growl" showDetail="true" showSummary="true" globalOnly="false"/>

        <pe:osmap style="width:100%; height:500px;"
                  center="36.890257,30.707417"
                  zoom="13" model="#{markerSelectionView.simpleModel}">
            <p:ajax event="overlaySelect" listener="#{markerSelectionView.onMarkerSelect}" update="growl"/>
        </pe:osmap>
    </h:form>
</div>

<div class="card">
    <h5>Draggable Marker</h5>
    <p>Markers can be draggable: the <i>markerDrag</i> event fires when a marker is dropped. Drag a marker.</p>
    <h:form id="formDraggableMarkers">
        <p:growl id="growl" showDetail="true" showSummary="true" globalOnly="false"/>

        <pe:osmap style="width:100%; height:500px;"
                  center="36.890257,30.707417"
                  zoom="13" model="#{draggableMarkersView.draggableModel}">
            <p:ajax event="markerDrag" listener="#{draggableMarkersView.onMarkerDrag}" update="growl"/>
        </pe:osmap>
    </h:form>
</div>