Skip to content

Commit

Permalink
Documentation: Clarification and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Edan Schwartz committed May 7, 2014
1 parent 9313ec0 commit 4441edd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 19 deletions.
21 changes: 15 additions & 6 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,16 @@ require.config({
'leaflet-markercluster': 'mapApp/lib/vendor/leaflet.markercluster'
},
shim: {
// Shim configuration may be required.
// A Shim configuration is required for libraries which
// do not support AMD out of the box.
// See http://requirejs.org/docs/api.html#config-shim
'gmaps-markerclusterer-plus': {
exports: 'MarkerClusterer'
},
'leaflet-markercluster': {
deps: ['leaflet'],
exports: 'L.MarkerClusterGroup'
}
}
});
```
Expand All @@ -130,11 +138,14 @@ See [the AMD/Bower.js example app](https://github.com/hamweather/aerisjs/tree/ma

#### Specifying a Map Library

The Aeris.js library allows all of its components to be rendered either by using [Google Maps API v3.x](https://developers.google.com/maps/), or [OpenLayers](http://openlayers.org/). To instruct Aeris.js on which library to use, you must specify a map rendering *strategy*.
By default,tThe Aeris.js library uses [Leaflet](http://leafletjs.com/) as it core mapping library. You can change which mapping library is used by overriding the `aeris/maps/strategy` AMD path.

```javascript
require.config({
paths: {
// For Leaflet (default)
'aeris/maps/strategy': 'myApp/vendor/aerisjs/src/maps/leaflet'

// For Google Maps
'aeris/maps/strategy': 'myApp/vendor/aerisjs/src/maps/gmaps'

Expand All @@ -144,11 +155,9 @@ require.config({
});
```

All of the components of the public API are strategy-agnostic, meaning that they will interface which whatever strategy is provided to them. By setting the `strategy` path to `gmaps` or `openlayers`, Aeris.js components know to request the correct strategy implementation.

Not all functionalities are currently implemented for all map rendering strategies. If there's something you're sorely missing, I encourage you to take a look at how [strategy architecture](http://docs.aerisjs.com/api/classes/aeris.maps.AbstractStrategy.html) is implemented, and then submit a [pull request.](https://github.com/hamweather/aerisjs/pulls)
All of the components of the public API are strategy-agnostic, meaning that they will interface which whatever strategy is provided to them. By setting the `strategy` path to `gmaps` or `openlayers`, Aeris.js components know to request the correct strategy implementation. Note that CDN pacakges are hard-coded to use a single strategy.

Note that CDN pacakges are hard-coded to use a single strategy.
Not all functionalities are currently implemented for all map rendering strategies. See [*Supported Mapping Libraries*](usage.md#supported-mapping-libraries) for a breakdown of supported features.

The map libraries will be loaded for you as AMD modules -- there is no need to include them separately. See [Setting API Keys](#setting-api-keys) for instructions of map library configuration.

Expand Down
33 changes: 22 additions & 11 deletions docs/themes/markdown/views/install.md.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,21 @@ require.config({
// See https://github.com/Leaflet/Leaflet.markercluster
'leaflet-markercluster': 'mapApp/lib/vendor/leaflet.markercluster'
},

// A Shim configuration is required for libraries which
// do not support AMD out of the box.
// See http://requirejs.org/docs/api.html#config-shim
shim: {
// Shim configuration may be required.
// See http://requirejs.org/docs/api.html#config-shim
// Only required when using google maps
'gmaps-markerclusterer-plus': {
exports: 'MarkerClusterer'
},

// Only required when using Leaflet
'leaflet-markercluster': {
deps: ['leaflet'],
exports: 'L.MarkerClusterGroup'
}
}
});
```
Expand All @@ -130,28 +142,27 @@ See [the AMD/Bower.js example app](https://github.com/hamweather/aerisjs/tree/ma

#### Specifying a Map Library

The Aeris.js library allows all of its components to be rendered either by using [Google Maps API v3.x](https://developers.google.com/maps/), or [OpenLayers](http://openlayers.org/). To instruct Aeris.js on which library to use, you must specify a map rendering *strategy*.
By default,tThe Aeris.js library uses [Leaflet](http://leafletjs.com/) as it core mapping library. You can change which mapping library is used by overriding the `aeris/maps/strategy` AMD path.

```javascript
require.config({
paths: {
// For Google Maps
// Use Leaflet (default)
'aeris/maps/strategy': 'myApp/vendor/aerisjs/src/maps/leaflet'

// Use Google Maps
'aeris/maps/strategy': 'myApp/vendor/aerisjs/src/maps/gmaps'

// For OpenLayers
// Use OpenLayers
'aeris/maps/strategy': 'myApp/vendor/aerisjs/src/maps/openlayers'
}
});
```

All of the components of the public API are strategy-agnostic, meaning that they will interface which whatever strategy is provided to them. By setting the `strategy` path to `gmaps` or `openlayers`, Aeris.js components know to request the correct strategy implementation.

Not all functionalities are currently implemented for all map rendering strategies. If there's something you're sorely missing, I encourage you to take a look at how [strategy architecture]({{getApiDocUrl 'aeris.maps.AbstractStrategy' }}) is implemented, and then submit a [pull request.](https://github.com/hamweather/aerisjs/pulls)

Note that CDN pacakges are hard-coded to use a single strategy.

The map libraries will be loaded for you as AMD modules -- there is no need to include them separately. See [Setting API Keys](#setting-api-keys) for instructions of map library configuration.

Not all functionalities are currently implemented for all map rendering strategies. See [*Supported Mapping Libraries*](usage.md#supported-mapping-libraries) for a breakdown of supported features.



#### Setting API Keys
Expand Down
1 change: 0 additions & 1 deletion docs/themes/markdown/views/usage.md.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ There is currently some variation in feature support between the mapping library
**Google Map Base Layers** | ✓ | | ✓
**KML Layers** | ✓ | |
**Polygons** (eg. convective layers) | ✓ | |
**KML Layers** | ✓ | |
**Polylines** | ✓ | |
Expand Down
1 change: 0 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ There is currently some variation in feature support between the mapping library
**Google Map Base Layers** | ✓ | | ✓
**KML Layers** | ✓ | |
**Polygons** (eg. convective layers) | ✓ | |
**KML Layers** | ✓ | |
**Polylines** | ✓ | |


Expand Down

0 comments on commit 4441edd

Please sign in to comment.