コード例 #1
0
 /**
  * get a token that will zoom us one level into this mosaic
  * @access public
  */
 function getZoomInToken()
 {
     $out = new GeographMapMosaic();
     $zoomindex = array_search($this->pixels_per_km, $this->scales);
     if ($zoomindex === FALSE) {
         $zoomindex = 0;
     }
     $zoomindex++;
     if ($zoomindex <= count($this->scales)) {
         //figure out central point
         $centrex = $this->map_x + $this->image_w / $this->pixels_per_km / 2;
         $centrey = $this->map_y + $this->image_h / $this->pixels_per_km / 2;
         $scale = $this->scales[$zoomindex];
         $out->setScale($scale);
         $out->setMosaicFactor(2);
         $out->type_or_user = $this->type_or_user;
         //figure out what the perfect origin would be
         $mapw = $this->image_w / $scale;
         $maph = $this->image_h / $scale;
         $bestoriginx = $centrex - $mapw / 2;
         $bestoriginy = $centrey - $maph / 2;
         $out->setAlignedOrigin($bestoriginx, $bestoriginy);
         return $out->getToken();
     } else {
         return FALSE;
     }
 }