VOL3 / v-ol3

Vaadin OpenLayers 3 wrapper
Apache License 2.0
15 stars 18 forks source link

How to Add the PostRender as a new Listener on Map #102

Open ramanamuttana opened 6 years ago

ramanamuttana commented 6 years ago

i have seen the OnClickListener on the Map of gwt-ol3 . In javascript of Ol3.js there is a method in the map class as map.once(type,listener) now i want to write a listener on the map that whenever the map is rendered this newly written listener should run, i dont want do any Clickoperations ,,, for example i want to get the pixel values of a point (Polygon) , i want to write a listener that sends the pixel values to OLMapConncetor of v-ol3 the javascript code of ol3.js as

map.once('postrender', function() {
  var geometry = polyFeature.getGeometry();
  var coordinate = geometry.getCoordinates();
  var pixel1 = map.getPixelFromCoordinate(coordinate);
  var element = document.getElementById("log");
  element.innerText = pixel1;
});

can u add as a feature or give me any methods to design.