diff options
Diffstat (limited to 'chimere/templates/search/search_js.html')
| -rw-r--r-- | chimere/templates/search/search_js.html | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/chimere/templates/search/search_js.html b/chimere/templates/search/search_js.html index 814a3f4..2d545b4 100644 --- a/chimere/templates/search/search_js.html +++ b/chimere/templates/search/search_js.html @@ -11,11 +11,12 @@ $(function(){ geo_objects.push(c_lst[idx]); }{% endif %} var geo_features = {}; - for (idx=0 ; idx < geo_objects.length ; idx++){ - var c_idx = geo_objects[idx].properties.pk; - if (search_result.indexOf(c_idx) == -1){ - search_result.push(c_idx); - var geom_type = geo_objects[idx].geometry.type; + for (idx_obj=0 ; idx_obj < geo_objects.length ; idx_obj++){ + var c_idx_obj = geo_objects[idx_obj].properties.pk; + + if (search_result.indexOf(c_idx_obj) == -1){ + search_result.push(c_idx_obj); + var geom_type = geo_objects[idx_obj].geometry.type; if (geom_type == 'Point'){ action = 'addMarker'; } else if (geom_type == 'LineString'){ @@ -25,8 +26,8 @@ $(function(){ } else { continue } - geo_features[c_idx] = $('#main-map').chimere(action, - geo_objects[idx]); + geo_features[c_idx_obj] = $('#main-map').chimere(action, + geo_objects[idx_obj]); } } if (geo_objects.length){ |
