Advertisement
Guest User

SetSymbolizer

a guest
Aug 28th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     //Define estilo rotate
  2.     var symbolizerRotate = {
  3.     "Point": {
  4.         pointRadius: 20,
  5.         externalGraphic: "http://200.19.215.119:8080/img/joao/bt-rotate.png",
  6.         fillOpacity: 1,
  7.         },
  8.     };
  9.     var styleRotate = new OpenLayers.Style();
  10.     styleRotate.addRules([new OpenLayers.Rule({symbolizer: symbolizerRotate})]);
  11.     var styleMapRotate = new OpenLayers.StyleMap({"default": styleRotate});
  12.    
  13.     //Define estilo resize
  14.     var symbolizerResize = {
  15.     "Point": {
  16.         pointRadius: 20,
  17.         externalGraphic: "http://200.19.215.119:8080/img/joao/bt-resize.png",
  18.         fillOpacity: 1,
  19.         },
  20.     };
  21.     var styleResize = new OpenLayers.Style();
  22.     styleResize.addRules([new OpenLayers.Rule({symbolizer: symbolizerResize})]);
  23.     var styleMapResize = new OpenLayers.StyleMap({"default": styleResize});
  24.    
  25.     function setPointOfControlSymbolizer(typeOfFeature, selectedControl, layer){
  26.         var $map = $("#map");
  27.        
  28.         if(typeOfFeature != "POINT"){
  29.             if (selectedControl == "rotate"){
  30.                 layer.styleMap = styleMapRotate;
  31.             }
  32.             if (selectedControl == "resize"){
  33.                 layer.styleMap = styleMapResize;
  34.             }
  35.             if (selectedControl == "move"){
  36.                 $map.css('cursor', 'url(http://200.19.215.119:8080/img/joao/bt-move.png), pointer;');
  37.             }
  38.             if (selectedControl == "delete"){
  39.                 $map.css('cursor', 'url(http://200.19.215.119:8080/img/joao/bt-delete.png), pointer;');
  40.             }
  41.         }      
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement