NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I have this code with openstreetmaps (is a cicle, then I have more marker named marker1, marker2 ,marker3 and so on), but property curosor: pointer dont workk (I tried with a lot of browser of course).

// Create a marker feature 1    
var marker1 = new ol.Feature({
    geometry: new ol.geom.Point(ol.proj.fromLonLat([14.3619382, 46.0649361])),
    name: 'some text',
    description: 'other some text'
});

// Create a marker style 1  
var markerStyle1 = new ol.style.Style({
    image: new ol.style.Icon({
    src: '/assets/images/ico.png',
    scale: 1            }),
    cursor: 'pointer'
});

// Set style to marker feature 1    
marker1.setStyle(markerStyle1);

// Add the marker feature 1 to the vector source
vectorSource.addFeature(marker1);

Also tried with css:

.ol-marker .ol-icon {
  cursor: pointer;
}

the same, dont work :( Someone can help me plese? Thanks in advanced

asked 01 Feb '23, 16:25

LucaFrass's gravatar image

LucaFrass
11112
accept rate: 0%

edited 02 Feb '23, 14:11

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1
×1
×1

question asked: 01 Feb '23, 16:25

question was seen: 365 times

last updated: 02 Feb '23, 14:11

Related questions

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum