there is a method in the OLMap class of v-ol3(vaadin-Openlayers4) as :
map.addClickListener(new OLMap.ClickListener() {
@Override
public void onClick(OLClickEvent clickEvent) {
//calling some method to execute when we click on the map
}
});
when ever we click on the map
new OLmap.ClickListener()
will act and will call the method written inside the onClick() method ,but i want without click on the map which means when the map is rendered there should be some listener that will call the method inside some event. As per the API what i understood is they implemented for the ClickListener on the map , now i want to extend an API for a Listener that will be called when the map is rendered
is there any such kind of Listener in java that will be called immediately after the application is launched ?
actually i want to get the Pixel values of the Point which i am able to get in javascript as shown below ,
map.once('postrender', function() {
var geometry = polyFeature.getGeometry();
var coordinate = geometry.getCoordinates();
var pixel1 = map.getPixelFromCoordinate(coordinate);
});
map.setView(view)
but i want to implement in java using v-ol3 jar , but there is only implementation for the click listener on the map and not for the map rendered listener , so what kind of Listener do i need to implement for that or is there any kind of Listener in java ?
Importanat:v-ol3 depends on the gwt-ol3(GWT_Opelayers) . in the gwt-ol3 the ol.js(openlayers is wrapped )