Changes between Version 6 and Version 7 of Addins/Bookmark

Show
Ignore:
Timestamp:
08/15/08 08:56:02 (5 years ago)
Author:
hpbrantley
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Addins/Bookmark

    v6 v7  
    33 
    44== Description == 
    5 The Bookmark control provides a simple means to "bookmark" a location. 
     5The Bookmark control provides a simple means to "bookmark" or "remember" a location.  
    66 
    77== Examples == 
    8  * [http://www.brantleys.com/maps/examples/bookmark.html bookmark.html] - A basic example of the Bookmark in action. (until sandbox is created) 
    9  * [http://www.brantleys.com/maps/examples/bookmark-custom.html bookmark-custom.html] - An example demonstrating advanced configurations of the Bookmark control. (until sandbox is created) 
    10  
    11  * [http://dev.openlayers.org/addins/bookmark/trunk/examples/bookmark.html bookmark.html] - A basic example of the !Bookmark in action. 
    12  * [http://dev.openlayers.org/addins/bookmark/trunk/examples/bookmakr-custom.html bookmark-custom.html] - An example demonstrating advanced configurations of the Bookmark control. 
     8 * [http://dev.openlayers.org/sandbox/hpbrantley/openlayers/examples/bookmark.html bookmark.html] - A basic example of the Bookmark in action. 
     9 * [http://dev.openlayers.org/sandbox/hpbrantley/openlayers/examples/bookmark-custom.html bookmark-custom.html] - An example demonstrating advanced configurations of the Bookmark control. 
    1310 
    1411== Installation and Use == 
    1512 1. Use subversion to check out the [http://svn.openlayers.org/addins/bookmark/trunk/ Bookmark] addin. 
    16  1. Place the [source:addins/bookmark/trunk/lib/OpenLayers/Control/Bookmark.js Bookmark.js] file in your [source:trunk/openlayers/lib/OpenLayers/Control/ Control] directory (or alternatively, place it elsewhere and add a {{{<script>}}} tag to your page that points to it). 
     13 1. Place the [http://dev.openlayers.org/sandbox/hpbrantley/openlayers/lib/OpenLayers/Control/Bookmark.js Bookmark.js] file in your [source:http://dev.openlayers.org/sandbox/hpbrantley/openlayers/lib/OpenLayers/Control/ Control] directory (or alternatively, place it elsewhere and add a {{{<script>}}} tag to your page that points to it). 
    1714 1. Use the [wiki:Profiles build tools] to create a single file build (or link to your !OpenLayers.js file to run in development mode). 
    18  1. Add a stylesheet to your page to style the Bookmark (see examples). 
     15 1. Add a stylesheet to your page to style the Bookmark, [http://dev.openlayers.org/sandbox/hpbrantley/openlayers/examples/bookmark.css bookmark.css]. 
    1916 1. Construct a map and add a Bookmark to it with the following syntax: 
    2017 
     
    3128 
    3229== Advanced Usage == 
    33 Passing a user defined function and value.  This function will be called when bookmark.zoomTo() method is called.  This can 
    34 be triggered by the user clicking the bookmark in the DIV or, if no DIV is defined, using something similar 
    35 to  
     30=== Bookmarks with no DIV === 
     31The developer can allow interaction with the Bookmark control without adding it as a map control.  Simply pass the map reference to the constructor.  Using this method, the CSS declarations are not needed. 
     32{{{ 
     33 
     34var map = new OpenLayers.Map("map"); 
     35var bookmark = new OpenLayers.Control.Bookmark({ 'map': map }); 
     36bookmark.add("BOSTON","-71.401901,41.989908,-70.698776,42.693033"); 
     37}}} 
     38 
     39=== Bookmarks Outside the Map === 
     40{{{ 
     41<style> 
     42#myBookmarks { height: 200px; width: 15em; float: right; } 
     43#myBookmarks #olBookmarkElement { cursor : pointer; } 
     44</style> 
     45}}} 
    3646 
    3747{{{ 
     48var map = new OpenLayers.Map("map"); 
     49bookmark = new OpenLayers.Control.Bookmark({ 'div':OpenLayers.Util.getElement('myBookmarks'), 'title': 'Bookmarks outside the map' }); 
     50map.addControl(bookmark); 
     51}}} 
     52{{{ 
     53<body> 
     54<!-- Div to contain the bookmarks --> 
     55<div id="myBookmarks"></div> 
     56<div id="map"></div> 
     57</body> 
     58}}} 
     59 
     60=== Passing Developer Defined Function === 
     61Passing a developer defined function and value.  This function will be called when bookmark.zoomTo() method is called.  This can 
     62be triggered by the user clicking the bookmark in the DIV or, if no DIV is defined, using something similar 
     63to: 
     64 
     65{{{ 
     66var map = new OpenLayers.Map("map"); 
     67var bookmark = new OpenLayers.Control.Bookmark(); 
     68 
    3869/* add a bookmark with user defined function and value */ 
    3970bookmark.add("BOSTON","-71.401901,41.989908,-70.698776,42.693033",Msg,"Welcome to Boston"); 
    4071 
    41 bookmark.zoomTo(bookmark.find("boston"));. 
     72bookmark.zoomTo(bookmark.find("boston")[0]);. 
    4273 
    4374function Msg(val) { alert(val); } 
    4475}}} 
    4576 
    46 == Style == 
    47 The look of the Bookmark contol is styled using css elements.  If the bookmark is used without a defining DIV, no css  
    48 elements are required. 
     77== Styling == 
     78The look of the Bookmark contol is styled using CSS elements.  If the Bookmark is used without a defining DIV, no CSS  
     79elements are required. See CSS examples [http://dev.openlayers.org/sandbox/hpbrantley/openlayers/examples/bookmark.css bookmark.css]. 
    4980 
    5081{{{ 
     
    5990 
    6091/* bookmark data elements */ 
     92 
    6193.olControlBookmarkElements {} 
    6294 
     
    77109}}} 
    78110 
     111== Properties & Methods == 
     112See [http://dev.openlayers.org/sandbox/hpbrantley/openlayers/lib/OpenLayers/Control/Bookmark.js Bookmark.js] for descriptions and explanations.