Skip to content
Snippets Groups Projects
Commit cccd5461 authored by Brandon Bergren's avatar Brandon Bergren
Browse files

More array documentation.

parent f901f9f6
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ The top level of a GMap array will look something like this: ...@@ -26,6 +26,7 @@ The top level of a GMap array will look something like this:
'<a href="#tl-bl" >baselayers</a>' => array(), // Enabled map baselayers. '<a href="#tl-bl" >baselayers</a>' => array(), // Enabled map baselayers.
'<a href="#tl-styles" >styles</a>' => array(), // Shape style definitions. '<a href="#tl-styles" >styles</a>' => array(), // Shape style definitions.
'<a href="#tl-behavior">behavior</a>' => array(), // various map behavior flags '<a href="#tl-behavior">behavior</a>' => array(), // various map behavior flags
'<a href="#tl-rmtcb" >rmtcallback</a>' => // Remote callback for ahah info windows.
'<a href="#tl-markers" >markers</a>' => array(), // array of points on the map '<a href="#tl-markers" >markers</a>' => array(), // array of points on the map
'<a href="#tl-shapes" >shapes</a>' => array(), // array of shapes to overlay on the map '<a href="#tl-shapes" >shapes</a>' => array(), // array of shapes to overlay on the map
); );
...@@ -318,6 +319,26 @@ The top level of a GMap array will look something like this: ...@@ -318,6 +319,26 @@ The top level of a GMap array will look something like this:
</dl> </dl>
</li> </li>
<li><a name="tl-rmtcb">rmtcallback</a>
<dl>
<dt>Values:</dt>
<dd>Base url of callback path. (String)</dd>
<dt>Description:</dt>
<dd>
This specifies the location that GMap needs to call the Drupal site back at to
retrieve the contents of an ahah info window.
</dd>
<dt>Example:</dt>
<dd>check_url(url('my/callback'))</dd>
<dt>Notes:</dt>
<dd>
Each marker can have a <a href="#ma-rmt">rmt</a> parameter that determines what
is appended to the path when making the callback. This should be used to pass
a unique identifier to your callback so you can retrieve the correct data.
</dd>
</dl>
</li>
<li><a name="tl-markers">markers</a> <li><a name="tl-markers">markers</a>
<dl> <dl>
<dt>Values:</dt> <dt>Values:</dt>
...@@ -406,12 +427,16 @@ Addon modules can add more types of overlays. ...@@ -406,12 +427,16 @@ Addon modules can add more types of overlays.
<pre> <pre>
$marker = array( $marker = array(
'<a href="ma-lat" >latitude</a>' => 0.000, '<a href="#ma-lat" >latitude</a>' => 0.000, // Marker latitude.
'<a href="ma-lon" >longitude</a>' => 0.000, '<a href="#ma-lon" >longitude</a>' => 0.000, // Marker longitude.
'<a href="ma-options">options</a>' => array(), '<a href="#ma-mn" >markername</a>' => 'smileyface', // Name of marker set to use.
'<a href="ma-text" >text</a>' => 'popup text', '<a href="#ma-offset" >offset</a>' => 0, // Offset in marker set.
'<a href="ma-mn" >markername</a>' => '<a href="#ma-text" >text</a>' => 'popup text', // GInfoWindow contents.
'<a href="ma-offset" >offset</a>' => 0, '<a href="#ma-tabs" >tabs</a>' => array(), // Tabbed GInfoWindow contents.
'<a href="#ma-link" >link</a>' => 'http://google.com', // Use marker as hyperlink.
'<a href="#ma-rmt" >rmt</a>' => '', // Argument to pass for rmt
'<a href="#ma-opts" >opts</a>' => array(), // Use custom GMarkerOptions.
'<a href="#ma-options">options</a>' => array(), // Misc. behavior modifications.
); );
</pre> </pre>
...@@ -451,28 +476,148 @@ Addon modules can add more types of overlays. ...@@ -451,28 +476,148 @@ Addon modules can add more types of overlays.
</dl> </dl>
</li> </li>
<li><a name="ma-mn">markername</a>
<dl>
Attribute: <dt>Values:</dt>
markername <dd>The name of the icon set to use (String)</dd>
Values: <dt>Description:</dt>
The name of the icon set to use (String) <dd>
Description:
Marker icons are located in the GMap module's 'markers' directory. Marker icons are located in the GMap module's 'markers' directory.
GMap reads the .ini files to find available markers. GMap reads the .ini files to find available markers.
Example: </dd>
"Light Blue" <dt>Example:</dt>
Notes: <dd>"Light Blue"</dd>
Some marker sets <dt>Notes:</dt>
sequential markers are available; for example, if the markername is set to "number", then the icons in the marker directory named 'number1.png', 'number2.png' etc. will be used. If these don't exist 'number.png' would be used. If that doesn't exist then the default marker will be used. <dd>Some markers have multiple icons. Use <a href="#ma-offset">offset</a> to choose which one to show.</dd>
</dl>
</li>
<li><a name="ma-offset">offset</a>
<dl>
<dt>Values:</dt>
<dd>The index of the marker to use (Integer)</dd>
<dt>Description:</dt>
<dd>For markernames with multiple icons, you can choose which one to use.</dd>
<dt>Example:</dt>
<dd>0</dd>
<dt>Notes:</dt>
<dd>
<p>The code will automatically wrap around if you simply increment offset every marker.</p>
<p>You do not need to know how many icons are actually assigned to the marker set.</p>
</dd>
</dl>
</li>
<li><a name="ma-text">text</a>
<dl>
<dt>Values:</dt>
<dd>HTML or Text to show in info window on marker click (String)</dd>
<dt>Description:</dt>
<dd>
<p>This will set up an info window popup when you click the marker.</p>
<p>If you specify as a string, it will make a regular GInfoWindow.</p>
<p>If you specify as an array, it will make a tabbed GInfoWindow, where the
array keys are the tab titles, and the array values are the contents of the
tabs.</p>
</dd>
<dt>Example:</dt>
<dd>"Point A"</dd>
<dt>Notes:</dt>
<dd>
Anything put in here will be sent inline to the javascript side, so if you are
planning on using complex popups, you may want to consider using <a href="ma-rmt">rmt</a> instead.
</dd>
</dl>
</li>
<li><a name="ma-tabs">tabs</a>
<dl>
<dt>Values:</dt>
<dd>array('' => '',...)</dd>
<dt>Description:</dt>
<dd>
Tab titles and HTML or text to show in info window on marker click.
</dd>
<dt>Example:</dt>
<dd>
<pre>
array(
'Name' => '&lt;em&gt;United States&lt;/em&gt;',
'Currency' => 'United States Dollar',
);
</pre>
</dd>
<dt>Notes:</dt>
<dd>
Anything put in here will be sent inline to the javascript side.
</dd>
</dl>
</li>
<li><a name="ma-link">link</a>
<dl>
<dt>Values:</dt>
<dd>A url to go to when the marker is clicked. (String)</dd>
<dt>Description:</dt>
<dd>
This will program the marker to act like a hyperlink.
</dd>
<dt>Example:</dt>
<dd>"http://google.com/"</dd>
<dt>Notes:</dt>
<dd>
It is pointless to specify <a href="#ma-text">text</a> or <a href="#ma-tabs">tabs</a>
at the same time as link, as link causes immediate navigation away from the map.
</dd>
</dl>
</li>
<li><a name="ma-foo">rmt</a>
<dl>
<dt>Values:</dt>
<dd>Path to append to the rmtcallback. (String)</dd>
<dt>Description:</dt>
<dd>
When using ahah markers, this should be set to the identifiers expected by
your callback.
</dd>
<dt>Example:</dt>
<dd>"15/0"</dd>
<dt>Notes:</dt>
<dd>
If you need to pass multiple identifiers, just seperate them with slashes.
</dd>
</dl>
</li>
Attribute: text <li><a name="ma-opts">opts</a>
Values: "map bubble text" <dl>
Description: text and/or HTML to be displayed in the map bubble when the marker is clicked <dt>Values:</dt>
Example: "Point A" <dd>array('' => ...,...)</dd>
Notes: @@@ Bdragon mentioned an "array tabs trick"?? <dt>Description:</dt>
<dd>
<p>Filling out this parameter will allow you to override the <em>GMarkerOptions</em>
that a marker is initialized with.</p>
<p>The <em>icon</em> key is automatically filled in, you can't set it here.</p>
</dd>
<dt>Example:</dt>
<dd>
<pre>
array(
'bouncy' => TRUE,
);
</pre>
</dd>
<dt>Notes:</dt>
<dd>
The documentation for <em>GMarkerOptions</em> can be found <a href="http://code.google.com/apis/maps/documentation/reference.html#GMarkerOptions">here</a>.
</dd>
</dl>
</li>
opts
options
<!-- <!--
<li><a name="ma-foo">foo</a> <li><a name="ma-foo">foo</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment