Changes between Version 23 and Version 24 of Documentation
- Timestamp:
- 08/24/07 10:20:51 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation
v23 v24 1 1 = !OpenLayers !JavaScript API Documentation = 2 2 3 Automatically generated API documentation is available from [http://dev.openlayers.org/ docs/files/OpenLayers-js.html Natural Docs on dev.openlayers.org]. See [NaturalDocs Natural Docs conventions] if you are contributing code.3 Automatically generated API documentation is available from [http://dev.openlayers.org/apidocs/files/OpenLayers-js.html Natural Docs on dev.openlayers.org]. See [NaturalDocs Natural Docs conventions] if you are contributing code. 4 4 5 Some code samples: 6 Hello World example: 7 {{{ 8 <html> 9 <head> 10 <script src="http://openlayers.org/api/2/OpenLayers.js"></script> 11 </head> 12 <body> 13 <div style="width:100%; height:100%" id="map"></div> 14 <script defer="defer" type="text/javascript"> 15 var map = new OpenLayers.Map('map'); 16 var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", 17 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} ); 18 map.addLayer(wms); 19 map.zoomToMaxExtent(); 20 </script> 21 </body> 22 </html> 23 }}} 5 == API Stability == 24 6 25 Add a [wiki:Control/LayerSwitcher LayerSwitcher control]: 26 {{{ 27 map.addControl(new OpenLayers.Control.LayerSwitcher()); 28 }}} 7 There are two types of properties/methods in the OpenLayers code: One set is the set of API Methods and properties. There are also additional internal properties which are not exposed to the API. Javascript does not have private members, so there is no technical limitation to using these non-documented methods in Application code. However, while we make every effort not to change APIs between releases, methods and properties which are not explicitly declared as API Methods may change in minor releases. 29 8 30 Add a [wiki:Layer/Text TextFile Layer]: 31 {{{ 32 map.addLayer(new OpenLayers.Layer.Text("Data", "datafile.txt")); 33 }}} 9 The documentation above only includes the API Methods. Full developer/internal library documentation is also available, but methods which are not available in the documentation above can not be depended upon to stay the same between releases. If you use methods included in these docs, you may have to make modifications in your application code to run between minor releases of OpenLayers. 34 10 35 Add a [wiki:Layer/Markers Markers Layer], and create a marker: 36 {{{ 37 var markersLayer = new OpenLayers.Layer.Markers("Some Points of Interest"); 38 var marker = new OpenLayers.Marker( 39 new OpenLayers.LonLat(5,10), 40 new OpenLayers.Icon( 41 "http://openlayers.org/api/img/marker.png", 42 new OpenLayers.Size(10,15) 43 )); 44 markersLayer.addMarker(marker); 45 map.addLayer(markersLayer); 46 }}} 47 11 [http://dev.openlayers.org/docs/files/OpenLayers-js.html Library Natural Docs on dev.openlayers.org] 48 12 49 13 == Incomplete API Documentation ==
