Why not ask your question on the new OpenStreetMap Community Forum?

I have a marker such as this

var feature = new OpenLayers.Feature.Vector(
                      new OpenLayers.Geometry.Point( lng,lat ).transform(epsg4326, projectTo),
                      {description:'something'} ,
                      {externalGraphic: 'somepic.png', graphicHeight:34, graphicWidth: 21, graphicXOffset:0,   
                                      graphicYOffset:0 }); 

i was wondering if there is a way to add onclick function to the markers, so an example use would be something like

feature.onClick(function (){

asked 31 Mar '12, 19:03

bernabasd's gravatar image

accept rate: 0%

closed 31 Mar '12, 20:01

Frederik%20Ramm's gravatar image

Frederik Ramm ♦

The question has been closed for the following reason "Question is off-topic or not relevant" by Frederik Ramm 31 Mar '12, 20:01

This is an OpenStreetMap help forum but your question is a general OpenLayers question. The OpenLayers "users" mailing list at http://lists.osgeo.org/mailman/listinfo/openlayers-users/ would be a good place to ask such a question.

permanent link

answered 31 Mar '12, 20:01

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
accept rate: 23%

Follow this question

By Email:

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



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:


question asked: 31 Mar '12, 19:03

question was seen: 8,247 times

last updated: 31 Mar '12, 20:01

powered by OSQA