Sundsvallskommun / OpenEMap-WebUserInterface

Open eMap user interface for the main map client
GNU Affero General Public License v3.0
4 stars 5 forks source link

Zoom slider - Show scale instead of zoom level (2h) #180

Open anderserla opened 9 years ago

anderserla commented 9 years ago

Example: You can achieve this by defining a lookup object mapping e. g. the zoom level to a text:

var lookup = {
    0: "International" ,
    1: "National",
    // ...
}

and read the text defined by the zoom level and pass it via the 'getText' function of the slider's tip , like this (untested):


     plugins: new Ext.slider.Tip({
         getText: function(thumb){
             return String.format('{0}', lookup[thumb.value]);
         }
     })