Reputation: 1442
I'm working on openlayer3 map, i had draw one bbox on map, now i want to find height and width of this bbox. Please let me know how to get this.
I had already tried map.getPixelFromCordinate
but not able to get the size of it.
Yellow color border is bbox, for which i want height and width.
Please help me out.
Upvotes: 1
Views: 397
Reputation: 694
For getting heigh&width of bbox you can follow this way.
1) pass one by one coordinate to map.getPixelFromCordinate(), this will returns pixels.
2) subtract two pixels for x coordinate as well as y. this will be height and width for that zoom level.
Upvotes: 2