mahdy
mahdy

Reputation: 1

Google map and openlayers

what is the ol3 (openlayers) equivalent of this google.maps event : google.maps.event.addDomListener(window, 'load', initialize);

Upvotes: 0

Views: 217

Answers (2)

Elton Schivei Costa
Elton Schivei Costa

Reputation: 109

Use the 'once' method of your map instance.

map.getView().once('change', fn...)
map.getView().once('change:resolution', fn...)
map.once('postrender', fn...)

More References here

Upvotes: 1

tsauerwein
tsauerwein

Reputation: 6051

The load event is called when the document has finished loading? OpenLayers does not provide an event for this, but you can use jQuery's $(document).ready().

Upvotes: 0

Related Questions