[commits] [Wiki] changed: HordeMap

Michael Rubinsky mrubinsk at horde.org
Mon Aug 15 21:24:59 UTC 2011


mrubinsk  Mon, 15 Aug 2011 21:24:58 +0000

Modified page: http://wiki.horde.org/HordeMap
New Revision:  1.3
Change log:  Add notes about delayed and map.display() method

@@ -45,20 +45,20 @@
  	 array(
  		'authentication' => 'none',
  	    'session_control' => 'none'));

-// Hordemap parameters. Driver will always be "Horde" unless you are working
-// with a custom developed map driver.
-// providers is an array of available mapping layers.
-// geocoder is the desired geocoder to use, pass Null to use default  
null geocoder.
-// Typically these would come from the application's global
-// configuration array ($conf)
+// Hordemap parameters.
  $params = array(
+    // Always "Horde" for horde's map driver.
  	'driver' => 'Horde',
+    // Provider layers that we want displayed
  	'providers' => array('Yahoo', 'Google', 'Public', 'Mytopo'),
+    // Geocoder to use.
  	'geocoder' => 'Google'
  );
+// JSON encode for output in the javascript
  $providerJson = json_encode($params['providers']);
+
  // Setup translations
  $language = str_replace('_', '-', $GLOBALS['language']);
  $language = $GLOBALS['language'];
  if (!file_exists($GLOBALS['registry']->get('jsfs', 'horde') .  
'/map/' . $language . '.js')) {
@@ -67,11 +67,11 @@

  // Additional configurations.
  $params['conf'] = array(
      // If using a marker image
-    'markerImage' => (string)Horde_Themes::img('map/marker.png'),
-    'markerBackgroun$d' =>  
(string)Horde_Themes::img('map/marker-shadow.png'),
-    'useMarkerLayer' => true,
+    //'markerImage' => (string)Horde_Themes::img('map/marker.png'),
+    //'markerBackground' =>  
(string)Horde_Themes::img('map/marker-shadow.png'),
+    //'useMarkerLayer' => true,
      // Use this language for translations if available.
      'language' => $language,
  );

@@ -129,13 +129,17 @@
         $H(p.getLayers()).values().each(function(e) {layers.push(e);});
      });
      map = new HordeMap.Map['Horde']({
  	elt: $('mapdiv'),
+        // If delayed is set to true, the map will not display until  
map.display()
+        // is called (see below).
          //delayed:true,
          layers: layers,
      	markerDragEnd: function(r) {alert('markerdragend');},
  	    mapClick: function(r) {alert('mapclick')}
      });
+    // Must call map.display() when you want the map to display when the
+    // delayed property is set to true.
      //map.display();
  });
  </script>
  <h2>HordeMap Example</h2>



More information about the commits mailing list