0

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/

regards

delete flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
0

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

vincentjian gravatar image vincentjian
2245 6

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

Hi,

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

<script><![CDATA[
zk.afterLoad('openlayers', function() {
    var _openlayers = {};
    zk.override(openlayers.Openlayers.prototype, _openlayers, {
        bind_: function (desktop, skipper, after) {
            _openlayers.bind_.apply(this, arguments);
            this.map.events.on({
                zoomend: this.proxy(this.zoomend)
            });
        },
        zoomend: function() {
            zk.log('current zoom level', this.map.zoom);
        }
    });
});
]]></script>
link publish delete flag offensive edit

Comments

Thanks, that works for me!

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

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

Follow
1 follower

RSS

Stats

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

Seen: 23 times

Last updated: Oct 23 '14

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