Openlayer Openstreetmap

asked 2014-05-13 10:56:29 +0800

mock gravatar image mock
34 2

updated 2014-05-13 13:17:34 +0800

Hi guys,

how can I detect a zoom event on the map by using the implementation of this blog… http://blog.zkoss.org/index.php/2012/07/03/zk-openlayers-integration/


delete flag offensive retag edit

2 Answers

Sort by » oldest newest most voted

answered 2014-05-14 09:56:57 +0800

vincentjian gravatar image vincentjian
2245 6

updated 2014-05-14 09:58:46 +0800


You can try add the zoom callback function by override the ZK openlayer widget

zk.afterLoad('openlayers', function() {
    var _openlayers = {};
    zk.override(openlayers.Openlayers.prototype, _openlayers, {
        bind_: function (desktop, skipper, after) {
            _openlayers.bind_.apply(this, arguments);
                zoomend: this.proxy(this.zoomend)
        zoomend: function() {
            zk.log('current zoom level', this.map.zoom);
link publish delete flag offensive edit


Thanks, that works for me!

mock ( 2014-05-20 12:10:30 +0800 )edit

answered 2014-10-23 19:54:00 +0800

mock gravatar image mock
34 2

Hey, i want to set the zoom and the map center with this code:

olMap.setCenter(new LonLat(currentLoc.getPosLng(), currentLoc.getPosLat()).transform(new Projection( "EPSG:4326"), olMap.getProjection()), 14, false, true);

The part which set the center works, but the zoom part not??? Any ideads...

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2014-05-13 10:56:29 +0800

Seen: 24 times

Last updated: Oct 23 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More