Projet

Général

Profil

Révision 135e59fc

Ajouté par Jocelyn Delande il y a plus de 10 ans

linked the map points to panorama visualization

Voir les différences:

ajax/all_points.php
25 25

  
26 26

  
27 27
function get_site_points() {
28
	$dir = "../tiles";
28
	$dir = "../tiles";//FIXME
29 29
	return (new sites_dir($dir))->get_sites();
30 30
}
31 31

  
......
43 43
	                                 "type" => "Point",
44 44
	                                 "coordinates" => [$lon, $lat]
45 45
	                                 ),
46
	             "properties" => array("name" => $name, "type" => 'pano_point')
46
	             "properties" => array("name" => $name,
47
	                                   "type" => 'pano_point',
48
	                                   "view_url"  => $sp->get_url())
47 49
	             );
48 50
}
49 51

  
class/site_point.class.php
87 87

  
88 88
  public function get_url() {
89 89
	  return sprintf('panorama.php?dir=%s&panorama=%s',
90
	                 dirname($this->base_dir), $this->get_name());
90
	                 'tiles', $this->get_name());
91 91
  }
92 92
}
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