Fixed a bug in parsing the thickness and color of lines and added TODOs.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Wed, 14 Aug 2013 21:17:02 +0000 (21:17 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Wed, 14 Aug 2013 21:17:02 +0000 (21:17 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1513 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrmap.body.php

index e5e36b9e76c5d2000cbe05bd2bf32b3df0f59147..5c1afabac5b9bf74b688e01f332abcf1f841d603 100644 (file)
@@ -95,8 +95,8 @@ function xml_to_json_features($input) {
                        $allowed_properties = array('farbe', 'dicke');
                        $wrong_properties = array_diff($given_properties, $allowed_properties);
                        if (count($wrong_properties) > 0) throw new Exception("Das Attribut '" . reset($wrong_properties) . "' ist nicht erlaubt bei <" . $feature->getName() . ">. Erlaubt sind: '" . implode("', '", $allowed_properties) . "'.");
-                       if (isset($feature['farbe'])) $properties['strokeColor'] = (int) $feature['farbe']; // e.g. 6
-                       if (isset($feature['dicke'])) $properties['strokeWidth'] = (string) $feature['dicke']; // e.g. #a200b7
+                       if (isset($feature['farbe'])) $properties['strokeColor'] = (string) $feature['farbe']; // e.g. #a200b7 // TODO: Check
+                       if (isset($feature['dicke'])) $properties['strokeWidth'] = (int) $feature['dicke']; // e.g. 6 // TODO: Check
                        $json_feature = array(
                                'type' => 'feature',
                                'geometry' => array(
@@ -127,7 +127,7 @@ class WrBaseMap {
                $tagname = strtolower(get_called_class()); // either wrmap or wrgmap
                assert(in_array($tagname, array('wrmap', 'wrgmap')));
 
-               // Get center and zoom level from $args
+               // Get center and zoom level from $args // TODO: What happens if the values are no correct e.g. float?
                if (isset($args['lat'])) $latitude = floatval($args['lat']); else $latitude = 47.267648;   // latitude as float value
                if (isset($args['lon'])) $longitude = floatval($args['lon']); else $longitude = 11.404655; // longitude as float value
                if (isset($args['zoom'])) $zoom = intval($args['zoom']); else $zoom = 10; // Google Zoom Level