Révision 135e59fc
Ajouté par Jocelyn Delande il y a plus de 10 ans
js/utils_osm.js | ||
---|---|---|
266 | 266 |
} |
267 | 267 |
|
268 | 268 |
|
269 |
function mk_point_cloud(feature) { |
|
270 |
/* Takes a ref_point or loc_point and makes a dom element to be used as map |
|
271 |
* popup |
|
272 |
*/ |
|
273 |
var div = document.createElement('div'); |
|
274 |
var ul = document.createElement('ul'); |
|
275 |
var title = feature.attributes.name; |
|
276 |
var desc, link; |
|
277 |
|
|
278 |
if (feature.attributes.type == 'pano_point') { |
|
279 |
desc = 'photo panoramique'; |
|
280 |
link = feature.attributes.view_url; |
|
281 |
} else { |
|
282 |
desc = 'point de référence'; |
|
283 |
} |
|
284 |
div.innerHTML = '<p><strong>'+title+'</strong></p>'; |
|
285 |
ul.innerHTML = '<li>'+desc+'</li>'; |
|
286 |
|
|
287 |
if (link) { |
|
288 |
ul.innerHTML += '<li><a href="'+ |
|
289 |
link+'" >Visualiser'; |
|
290 |
} |
|
291 |
|
|
292 |
div.appendChild(ul); |
|
293 |
return div.innerHTML; |
|
294 |
} |
|
295 |
|
|
269 | 296 |
function add_refpoint_control(layer, map) { |
270 | 297 |
var selectControl ; |
271 | 298 |
selectControl = new OpenLayers.Control.SelectFeature( |
... | ... | |
275 | 302 |
feature.attributes.name, |
276 | 303 |
feature.geometry.getBounds().getCenterLonLat(), |
277 | 304 |
null, |
278 |
"<div>" + feature.attributes.name+"</div>",
|
|
305 |
mk_point_cloud(feature),
|
|
279 | 306 |
null, true, function() {selectControl.unselect(feature);}); |
280 | 307 |
feature.popup = popup; |
281 | 308 |
map.addPopup(popup);}, |
Formats disponibles : Unified diff
linked the map points to panorama visualization