/** * Erstellt eine GoogleMap * * @param tx_rnbase_configurations $configurations * @param string $confId * @return tx_rnbase_maps_google_Map */ static function createGoogleMap(&$configurations, $confId) { $map = self::createMap('tx_rnbase_maps_google_Map', $configurations, $confId); $keys = $configurations->getKeyNames($confId . 'poi.'); if (isset($keys)) { tx_rnbase::load('tx_rnbase_maps_Util'); foreach ($keys as $key) { $poi = $configurations->get($confId . 'poi.' . $key . '.'); $poi = tx_rnbase::makeInstance('tx_rnbase_maps_POI', $poi); $bubble = tx_rnbase_maps_Util::createMapBubble($poi); if (!$bubble) { continue; } $bubble->setDescription($poi->getDescription()); // Prüfen, ob ein Icon konfiguriert ist $iconConfId = $confId . 'poi.' . $key . '.icon.'; if ($configurations->get($iconConfId)) { $icon = tx_rnbase::makeInstance('tx_rnbase_maps_google_Icon', $map); $icon = new tx_rnbase_maps_google_Icon($map); $image = $configurations->get($iconConfId . 'image', TRUE); $icon->setImage($image, $configurations->getInt($iconConfId . 'image.file.maxW'), $configurations->getInt($iconConfId . 'image.file.maxH')); $image = $configurations->get($iconConfId . 'shadow', TRUE); $icon->setShadow($image, $configurations->getInt($iconConfId . 'shadow.file.maxW'), $configurations->getInt($iconConfId . 'shadow.file.maxH')); $name = $configurations->get($iconConfId . 'name'); $icon->setName($name ? $name : tx_rnbase_util_Misc::createHash(array('name' => $image))); $bubble->setIcon($icon); } $map->addMarker($bubble); } } return $map; }
public function test_encodeParams() { $params['dat1'] = '1'; $params['dat2'] = array('1', '2'); $params['dat3'] = 123; $hash1 = tx_rnbase_util_Misc::createHash($params); $this->assertEquals(8, strlen($hash1)); $params['dat2'] = array('2', '2'); $hash2 = tx_rnbase_util_Misc::createHash($params); $this->assertEquals($hash2, $hash1); $hash2 = tx_rnbase_util_Misc::createHash($params, FALSE); $this->assertTrue($hash2 != $hash1); $params = array('1', array(1, 2), 123); $hash2 = tx_rnbase_util_Misc::createHash($params); $this->assertEquals($hash2, $hash1); $params = array(array(1, 2), '1', 123); $hash2 = tx_rnbase_util_Misc::createHash($params); $this->assertEquals($hash2, $hash1); }