Permalink
Browse files

Add KML layer doc

  • Loading branch information...
1 parent 8e420c0 commit ed3a21f18719fea4d7ac84f1704860d452835a60 @egeloen committed Mar 5, 2012
Showing with 77 additions and 1 deletion.
  1. +3 −1 README.markdown
  2. +7 −0 Resources/doc/usage/layers/index.md
  3. +67 −0 Resources/doc/usage/layers/kml_layer.md
View
@@ -2,7 +2,7 @@ Provides a Google Map integration for your Symfony2 Project.
[![Build Status](https://secure.travis-ci.org/egeloen/IvoryGoogleMapBundle.png)](http://travis-ci.org/egeloen/IvoryGoogleMapBundle)
-Actually, this bundle allows you to manage:
+Currently, this bundle allows you to manage:
- Map
- Controls: Map type, Overview, Pan, Rotate, Scale, Street view, Zoom
@@ -35,6 +35,8 @@ Documentation
- [Scale](http://github.com/egeloen/IvoryGoogleMapBundle/blob/master/Resources/doc/usage/controls/scale.md)
- [Street view](http://github.com/egeloen/IvoryGoogleMapBundle/blob/master/Resources/doc/usage/controls/street_view.md)
- [Zoom](http://github.com/egeloen/IvoryGoogleMapBundle/blob/master/Resources/doc/usage/controls/zoom.md)
+ - [Layers](http://github.com/egeloen/IvoryGoogleMapBundle/blob/master/Resources/doc/usage/layers/index.md)
+ - [KML Layer](http://github.com/egeloen/IvoryGoogleMapBundle/blob/master/Resources/doc/usage/layers/kml_layer.md)
- [Events](http://github.com/egeloen/IvoryGoogleMapBundle/blob/master/Resources/doc/usage/events.md)
- [Services](http://github.com/egeloen/IvoryGoogleMapBundle/blob/master/Resources/doc/usage/services/index.md)
- [Geocoding API](http://github.com/egeloen/IvoryGoogleMapBundle/blob/master/Resources/doc/usage/services/geocoding/geocoder.md)
@@ -0,0 +1,7 @@
+# Google Map Layers
+
+ - [KML Layer](http://github.com/egeloen/IvoryGoogleMapBundle/blob/master/Resources/doc/usage/layers/kml_layer.md)
+ - Fusion Table Layer
+ - Traffic Layer
+ - Bicycling Layer
+ - Panorama Layer
@@ -0,0 +1,67 @@
+# KML Layer
+
+The Google Maps API supports the KML and GeoRSS data formats for displaying geographic information. For more information, see official [documentation](http://code.google.com/apis/maps/documentation/javascript/layers.html#KMLLayers).
+
+## Build your KML layer
+
+### By configuration file
+
+By default, the bundle doesn't need any configuration. Most of the service have a default configuration which allows you to use the given objects like they are.
+The ``ivory_google_map.kml_layer`` service is. The configuration describes below is this default configuration.
+
+```
+# app/config/config.yml
+
+ivory_goole_map:
+ kml_layer:
+ # Prefix used for the generation of the KML layer javascript variable
+ prefix_javascript_variable: "kml_layer_"
+
+ # KML layer url
+ url: "http://domain.com/kml_layer.kml"
+
+ # Custom KML layer options
+ # By default, there is no options
+ options:
+ clickable: true
+ suppressInfoWindows: false
+```
+
+``` php
+<?php
+
+// Requests the ivory google map KML layer service
+$kmlLayer = $this->get('ivory_google_map.kml_layer');
+```
+
+### By coding
+
+``` php
+<?php
+
+// Requests the ivory google map KML layer service
+$kmlLayer = $this->get('ivory_google_map.kml_layer');
+
+// Configure your KML layer options
+$kmlLayer->setPrefixJavascriptVariable('kml_layer_');
+$kmlLayer->setUrl('http://www.domain.com/kml_layer.kml');
+
+$kmlLayer->setOption('clickable', true);
+$kmlLayer->setOption('suppressInfoWindows', false);
+$kmlLayer->setOptions(array(
+ 'clickable' => true,
+ 'suppressInfoWindows' => false
+));
+```
+
+## Add your KML layer to the map
+
+``` php
+<?php
+
+// Requests the ivory google map KML layer service
+$kmlLayer = $this->get('ivory_google_map.kml_layer');
+
+// Add your KML layer to the map
+$map->addKMLLayer($kmlLayer);
+```

0 comments on commit ed3a21f

Please sign in to comment.