--- layout: api title: "v2.2.0 JavaScript Library: L.mapbox.marker.style(feature, latlng)" categories: api version: v2.2.0 permalink: /api/v2.2.0/l-mapbox-marker-style ---

## L.mapbox.marker.style(feature, latlng)

An icon generator for use in conjunction with `pointToLayer` to generate markers from the Mapbox Markers API and support the simplestyle-spec for features.

Options | Value | Description
--- | --- | ---
feature | object | A GeoJSON feature object
latlng | object | The latitude, longitude position of the marker

Examples:

    L.geoJson(geoJson, {
        pointToLayer: L.mapbox.marker.style,
    });

Returns:

A `L.Marker` object with the latitude, longitude position and a styled marker

The other sections of the simplestyle-spec are implemented by `L.mapbox.simplestyle.style`