Changeset 319 for tools

Show
Ignore:
Timestamp:
05/01/09 16:08:57 (11 months ago)
Author:
daniel
Message:

geocode OL template final

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tools/routingservice/branches/wrs-2.0/data/templates/geocode/geocode_openlayers.st

    r318 r319  
    1414                                                                "geometry": \{ 
    1515                                                                        "type": "Point",  
    16                                                                         "coordinates": [ $p.point$ ] 
     16                                                                        "coordinates": $p.point$ 
    1717                                                                \}, 
    1818                                                                "crs": \{ 
     
    8787                            map.zoomToExtent(bounds); 
    8888                             
    89                             var feature = features[i]; 
    90                 feature.data.popupContentHTML = "$p.address$"; 
    91                 feature.data.overflow = (overflow) ? "auto" : "hidden"; 
    92                  
    93                 var popup = feature.createPopup(false); 
    94                 map.addPopup(popup); 
    95                 popup.show(); 
     89                                var feature = features[0]; 
     90                                var content = '<div style="padding:5px;font-size:.8em;font-weight:bold;">' + feature.data.address + '</div>' 
     91                                content    += '<div style="padding:5px;font-size:.8em;">Accuracy: ' + feature.data.AddressDetails.Accuracy + '</div>' 
     92                                content    += '<div style="padding:5px;font-size:.8em;">Location: ' + feature.geometry.toShortString() + '</div>' 
     93 
     94                                var popup = new OpenLayers.Popup.FramedCloud("chicken",  
     95                                        feature.geometry.getBounds().getCenterLonLat(), 
     96                                        null, content, null, false, false); 
     97         
     98                        map.addPopup(popup); 
     99                                popup.show(); 
    96100                        }  
    97101                        else {