aboutsummaryrefslogtreecommitdiff
path: root/resources/op2geojson.js
diff options
context:
space:
mode:
authorWilli <willi@jups42.de>2012-12-02 15:48:47 +0100
committerWilli <willi@jups42.de>2012-12-02 15:48:47 +0100
commite6553439a6857080c375c59ae8275112680b8efc (patch)
tree5a515becdb9e90368867b0047dddfe669319267e /resources/op2geojson.js
parent341797bc84fc0672e4eda0e79de815e7c2b123c8 (diff)
parent656847f983b84387229f6010fd000d0348566fa2 (diff)
downloadhealth-map-e6553439a6857080c375c59ae8275112680b8efc.tar
health-map-e6553439a6857080c375c59ae8275112680b8efc.tar.gz
Merge branch 'master' of github.com:filbertkm/hospital-map
Diffstat (limited to 'resources/op2geojson.js')
-rw-r--r--resources/op2geojson.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/resources/op2geojson.js b/resources/op2geojson.js
index 55be9e3..c453df7 100644
--- a/resources/op2geojson.js
+++ b/resources/op2geojson.js
@@ -5,8 +5,8 @@ op2geojson = function() {
var instance = {},
geojson;
- instance.fetch = function(url, callback) {
- $.getJSON(url, { format: "json" },
+ instance.fetch = function(url, data, callback) {
+ $.post(url, data,
function(data) {
// List all of the returned nodes
var nodes = [];
@@ -19,7 +19,8 @@ op2geojson = function() {
// Add nodes and ways to the layer
var features = [];
$.each(data.elements, function(i, item) {
- if( item.type === 'node' && item.tags != null ) {
+ if( item.type === 'node' && item.tags != undefined
+ && item.tags['amenity'] != undefined) {
features.push( instance.point(item) );
} else if (item.type === 'way') {
features.push( instance.lineString(item, nodes) );
@@ -28,7 +29,7 @@ op2geojson = function() {
geojson = instance.featureCollection(features);
callback(geojson);
}
- );
+ , "json");;
};
instance.point = function(node) {