Answer the question
In order to leave comments, you need to log in
How to put a label (a marker on a specific point with coordinates on the map) in OpenLayers 3?
openlayers.org/en/v3.1.1/examples/icon.js I
see this code for this example openlayers.org/en/v3.1.1/examples/icon.html
I don't understand what is responsible for the map marker here?
Answer the question
In order to leave comments, you need to log in
var iconFeature = new ol.Feature({
geometry: new ol.geom.Point([0, 0]),
name: 'Null Island',
population: 4000,
rainfall: 500
});
var iconStyle = new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
opacity: 0.75,
src: 'data/icon.png'
}))
});
iconFeature.setStyle(iconStyle);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question