Esempio n. 1
0
 protected function addPoint(Placemark $placemark)
 {
     parent::addPoint($placemark);
     $styleArgs = array();
     $style = $placemark->getStyle();
     $center = $placemark->getGeometry()->getCenterCoordinate();
     if ($style) {
         $color = $style->getStyleForTypeAndParam(MapStyle::POINT, MapStyle::COLOR);
         if ($color) {
             $styleArgs[] = 'color:' . htmlColorForColorString($color);
         }
         $size = $style->getStyleForTypeAndParam(MapStyle::POINT, MapStyle::SIZE);
         if ($size) {
             $styleArgs[] = 'size:' . $size;
         }
         $icon = $style->getStyleForTypeAndParam(MapStyle::POINT, MapStyle::ICON);
         if ($icon) {
             $styleArgs[] = 'icon:' . $icon;
         }
     }
     if (!$styleArgs) {
         $styleArgs = array('color:red', 'weight:4');
     }
     $styleString = implode('|', $styleArgs);
     if (!array_key_exists($styleString, $this->markers)) {
         $this->markers[$styleString] = array();
     }
     $this->markers[$styleString][] = $center['lat'] . ',' . $center['lon'];
 }