title: How to get the marker position in openlayer
body: <p>I have implemented a openlayer map with several markers with drupal. I want to get the longitude and latitude of the marker when I click on the marker. I have just write a code which shows the longitude and latitude when I click on the map. Instead I want to alert the position only when I click on the marker that I have plotted on the map. How to get the longitude and latitude of the marker?</p>
  
  <pre><code>jQuery(function ($) {
      var ol_data = $('.openlayers-map').data('openlayers');
      var map = ol_data.openlayers;
  
      map.events.register("click", map, function (e) {
          var lonlat = map.getLonLatFromPixel(e.xy);
          alert("You clicked near " + lonlat.lat + " N, " + +lonlat.lon + " E");
      });
  </code></pre>