function __construct($atts = null) { parent::__construct($atts); // Set the options; they may be passed as individual parameters or an 'options' array $this->options = Mappress_Options::get(); if (isset($atts['options'])) { $this->options->update($atts['options']); } else { $this->options->update($atts); } // Set language if (!$this->options->language) { $this->options->language = Mappress::get_language(); } // Convert POIs from arrays to objects if needed foreach ((array) $this->pois as $index => $poi) { if (is_array($poi)) { $this->pois[$index] = new Mappress_Poi($poi); } } // Set default size if no width/height specified if (!$this->width || !$this->height) { $i = (int) $this->options->size; if (isset(Mappress::$options->sizes[$i])) { $size = Mappress::$options->sizes[$i]; $this->width = $this->width ? $this->width : $size['width']; $this->height = $this->height ? $this->height : $size['height']; } } }