Projet

Général

Profil

Révision 598caaec

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

now displays the circles with the same color as on the pano (sortof...)

Voir les différences:

js/utils_osm.js
229 229
	return map;
230 230
}
231 231

  
232
function list2css_color(vals) {
233
	return "rgb("+vals+")";
234
}
235

  
232 236
function mk_all_refpoints_layer() {
237
	// Put the same style as panorama view for points
238
	var points_style = new OpenLayers.StyleMap({
239
		pointRadius: 10,
240
		fillOpacity: 0.5,
241
	});
242
	
243
	var lookup = {};
244
	
245
	for (var k in  point_colors ) {
246
		var css_color = list2css_color(point_colors[k]);
247
		lookup[k] = {
248
			fillColor: css_color,
249
			strokeColor: css_color
250
		};
251
	}
252
	console.log(lookup);
253
	points_style.addUniqueValueRules("default", "type", lookup);	
254
	
233 255
	var layer = new OpenLayers.Layer.Vector(
234 256
		"Reference points",{
235 257
			projection: new OpenLayers.Projection("EPSG:4326"),
......
237 259
			protocol: new OpenLayers.Protocol.HTTP({
238 260
				url: 'ajax/ref_points.php',
239 261
				format: new OpenLayers.Format.GeoJSON(),
240
			})
262
			}),
263
			styleMap: points_style
241 264
		});
242 265
	return layer;
243 266
}
......
262 285
				feature.popup.destroy();
263 286
				feature.popup = null;
264 287
			}});
265

  
288
	
266 289
	map.addControl(selectControl);
267 290
	selectControl.activate();
291

  
268 292
}
269 293

  

Formats disponibles : Unified diff