summaryrefslogtreecommitdiff
path: root/chimere/templates/search/search_js.html
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/templates/search/search_js.html')
-rw-r--r--chimere/templates/search/search_js.html12
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]);
}
}