Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function region(r,g,b,rr,rg,rb)
  2.  {
  3.      var area = new google.maps.MVCArray();
  4.      
  5.      var polygon = new google.maps.Polygon({
  6.          path: area,
  7.          strokeColor: rgb2hex (r,g,b),
  8.          strokeOpacity: 0.7,
  9.          strokeWeight: 6,
  10.          fillColor: rgb2hex(rr,rg,rb),
  11.          fillOpacity: 0.5
  12.      });
  13.      
  14.      
  15.      polygon.setMap(map);
  16.  
  17.  drawListener = google.maps.event.addListener(map, 'click', function(e)
  18.  {
  19.      var path = polygon.getPath();
  20.      path.push(e.latLng);
  21.      var marker = new google.maps.Marker({
  22.          position: e.latLng,
  23.          map: map,
  24.      })
  25.  });
  26.  
  27.  google.maps.event.addListener(polygon, 'mouseout', function(e)
  28.  {
  29.      polygon.setOptions(
  30.              {
  31.                  fillColor: rgb2hex(0,255,0),
  32.                  strokeColor: rgb2hex(255,255,0)
  33.              });
  34.  });
  35.  
  36.  google.maps.event.addListener(polygon, 'mouseover', function(e)
  37.  {
  38.      polygon.setOptions(
  39.              {
  40.                  fillColor: rgb2hex(255,0,0),
  41.          strokeColor: rgb2hex(0,0,255)
  42.              });
  43.          });
  44.          
  45.  
  46.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement