본문 바로가기

develop/web GIS

마커 생성 및 라벨 수정

 sprintersLayer = new OpenLayers.Layer.Vector('해양기후', {

     styleMap: new OpenLayers.StyleMap({

         externalGraphic: '../js/OpenLayers/img/marker.png',

         graphicOpacity: 1.0,

         graphicWith: 16,

         graphicHeight: 26,

         graphicYOffset: -26,

         fontColor: "red",

                  fontSize: "12px",

                  fontFamily: "Courier New, monospace",

                  fontWeight: "bold" 

     })

          });

sprintersLayer.addFeatures(getSprintersFeatures());

sprintersLayer.id="sprintersLayer";

map.addLayer(sprintersLayer);


//라벨 수정

sprintersLayer.styleMap.styles.default.defaultStyle.label = "101";

sprintersLayer.redraw();