Leaflet/Leaflet — pull request #1822 by Starefossen (2013-07-03 08:30:23+00:00)
Title: Adds support for altitude and 3D GeoJSON

This pull adds a third parameter to the L.LatLon class for specifying altitude. This is in turn stored in the `.latitude` property for the LatLng instance. Latitude property will only be set if the latitude parameter is not undefined, this is done in order to ensure backwards compability.

```javascript
var latlng = new L.LatLng(10, 20, 30);
console.log(latlng.altitude); // prints '30' to the console
```

Similar functionality has been added to L.GeoJSON coordsToLatLng() and latLngToCoords() methods in order to handle import and export of 3D GeoJSON.

```javascript
var geoJSON = {
type: 'Feature'
,properties: {}
,geometry: {
type: 'Point'
,coordinates: [20, 10, 30]
}
}
var layer = new L.GeoJSON();
layer.addData(geoJSON);
console.log(layer.getLayers()[0].getLatLng().altitude);
```

`NB` It is important to notice that no logic has been added in order to prevent latitude and longitude to change without appropirate change in altitude – this must be handled by the application.