You are here

function AddressToGeo::zoom in Geolocation Address Link 8

Helper for getZoom().

1 call to AddressToGeo::zoom()
AddressToGeo::getZoom in src/AddressToGeo.php
A method to roughly calculate the right zoom level for a place.

File

src/AddressToGeo.php, line 309

Class

AddressToGeo
Class AddressToGeo.

Namespace

Drupal\geolocation_address_link

Code

function zoom($mapPx, $worldPx, $fraction) {
  return floor(log($mapPx / $worldPx / $fraction) / log(2));
}