[OpenLayers-Users] Possiblity to rotate textelemente individual

Jan Tappenbeck osm at tappenbeck.net
Tue Apr 19 05:58:22 EDT 2011



  Hi !

i create text-object with following code:

     // Text-Style für die kleinen
	   var poiStyle1 =  {
	   strokeColor: "#FFFFFF",
	   strokeOpacity: 1,
	   strokeWidth: 3,
	   fillColor: "#FF5500",
	   fillOpacity: 1,
	   pointRadius: 6,
	   pointerEvents: "visiblePainted",
	   label : "${name}",

	   fontColor: "#000077",
	   fontSize: "12px",
	   fontFamily: "Arial",
	   fontWeight: "bold",
	   labelAlign: "cm",
	   labelXOffset: 0,
	   labelYOffset: 0
     };

	   var poiStyle1Select =  {
	   strokeColor: "#FFFFFF",
	   strokeOpacity: 1,
	   strokeWidth: 3,
	   fillColor: "#FF5500",
	   fillOpacity: 1,
	   pointRadius: 6,
	   pointerEvents: "visiblePainted",
	   label : "${name}",

	   fontColor: "#000077",
	   fontSize: "12px",
	   fontFamily: "Arial",
	   fontWeight: "bold",
	   labelAlign: "cm",
	   labelXOffset: 0,
	   labelYOffset: 0
     };	var aStylePoi1 = new OpenLayers.StyleMap( { "default" : new
	OpenLayers.Style(poiStyle1), "select" : new
	OpenLayers.Style(poiStyle1Select)} );

     vectorLabelLayer1 = new OpenLayers.Layer.Vector("label_region", {maxResolution: map.getResolutionForZoom(6)  });  // end-vectorLayer
     map.addLayer (vectorLabelLayer1);

	vectorLabelLayer1.styleMap = aStylePoi1;

    // Schleife mit den einzelnen Beschriftungsobjekte
    for ( i in label_name[1]){
       if (label_coord[1][i]){
	 	  var point = new OpenLayers.Geometry.Point(label_coord[1][i][1],label_coord[1][i][0]).transform(map.displayProjection, map.getProjectionObject());
	 	  var pointFeature = new OpenLayers.Feature.Vector(point);
	 	  pointFeature.attributes = {
	   		  name: label_name[1][i]
	   	  };
	      vectorLabelLayer1.addFeatures([pointFeature]);
       } // end-if
     } // end-for



is it possible to create a individual rotation for every object like

label : "${name}",


regards Jan .-)




More information about the Users mailing list