mercredi 25 mars 2015

LeafletJS Measurement of distance in deepzoom tilelayer


UPDATED INFORMATION:


I have been trying to understand how LeafletJS determines distances between two points in a layer. I am trying to implement the custom scale plugin, (and have done so successfully) on a static tiled image using the leaflet deepzoom tilelayer plugin.


My tiles are 256 x 256 pixels, with the exception being tiles on the outer edges that are sometimes odd measurements (i.e. 86px x 125px or something like that).


Using CRS.Simple, the image zoom is adjusted by powers of 2 by the looks of it:


CRS.Simple seems to operate in powers of 2 'o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}})


How do I calculate what each pixel / meter is at each zoom level, and how do I input it into Leaflet so that it uses the calculations to show a correct scale bar?





Aucun commentaire:

Enregistrer un commentaire