openlayers 3 - Coordinate length to pixel length mapping in ImageCanvas -


i want draw circles in image canvas. i'm able pixel values coordinate values calling map.coordinatetopixel.

for radius, how can map coordinate distance pixel length?

for instance, if radius 60 arc minutes, goes 50 degrees 51 degrees. in vector layer, underlying framework manages translation pixels depending on zoom level. however, imagecanvas, need specify myself. there method that? know might have dig code, wondering if there's inherent solution knows of.

an alternate option i've considered is:

  1. get coordinate @ pixel (0,0)

  2. get coordinate @ (radiuslogitude, 0)

  3. find diff between #2 - #1 on longitude , use radius

maybe example can you: http://acanimal.github.io/thebookofopenlayers3/chapter03_04_imagecanvas.html draw set of random pie charts (but without taking account pixel ratio).

note, canvasfunction use receives 5 parameters can determine pixel size: function(extent, resolution, pixelratio, size, projection)


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -