diff options
Diffstat (limited to 'chimere/templates')
-rw-r--r-- | chimere/templates/search/search_js.html | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chimere/templates/search/search_js.html b/chimere/templates/search/search_js.html index 44a7ee9..814a3f4 100644 --- a/chimere/templates/search/search_js.html +++ b/chimere/templates/search/search_js.html @@ -15,7 +15,17 @@ $(function(){ var c_idx = geo_objects[idx].properties.pk; if (search_result.indexOf(c_idx) == -1){ search_result.push(c_idx); - geo_features[c_idx] = $('#main-map').chimere('addMarker', + var geom_type = geo_objects[idx].geometry.type; + if (geom_type == 'Point'){ + action = 'addMarker'; + } else if (geom_type == 'LineString'){ + action = 'addRoute'; + } else if (geom_type == 'Polygon' || geom_type == 'MultiPolygon'){ + action = 'addPolygon'; + } else { + continue + } + geo_features[c_idx] = $('#main-map').chimere(action, geo_objects[idx]); } } |