~chiawen-ho/sahana-eden/test

« back to all changes in this revision

Viewing changes to views/gis/ol_functions.js

  • Committer: Tina
  • Date: 2010-08-01 09:45:20 UTC
  • Revision ID: tina@tina-vaio-20100801094520-iyifngvbd52k2dfc
initial version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// General functions usable by all Layers
 
2
 
 
3
// Report Errors to a DIV
 
4
function ReportErrors(div,text) {
 
5
     $(div).innerHTML = text;
 
6
}
 
7
// For OSM File layers
 
8
function on_feature_hover(feature) {
 
9
        var text ="<ul>";
 
10
        var type ="way";
 
11
        if (feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
 
12
            type = "node";
 
13
        }    
 
14
        text += "<li>" + feature.osm_id + ": <a href='http://www.openstreetmap.org/api/0.5/"+type + "/" + feature.osm_id + "'>API</a></li>";
 
15
        for (var key in feature.attributes) {
 
16
            text += "<li>" + key + ": " + feature.attributes[key] + "</li>";
 
17
        }
 
18
        text += "</ul>";
 
19
        $("status_osm").innerHTML = text;
 
20
}