Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function region(r,g,b,rr,rg,rb)
- {
- var area = new google.maps.MVCArray();
- var polygon = new google.maps.Polygon({
- path: area,
- strokeColor: rgb2hex (r,g,b),
- strokeOpacity: 0.7,
- strokeWeight: 6,
- fillColor: rgb2hex(rr,rg,rb),
- fillOpacity: 0.5
- });
- polygon.setMap(map);
- drawListener = google.maps.event.addListener(map, 'click', function(e)
- {
- var path = polygon.getPath();
- path.push(e.latLng);
- var marker = new google.maps.Marker({
- position: e.latLng,
- map: map,
- })
- });
- google.maps.event.addListener(polygon, 'mouseout', function(e)
- {
- polygon.setOptions(
- {
- fillColor: rgb2hex(0,255,0),
- strokeColor: rgb2hex(255,255,0)
- });
- });
- google.maps.event.addListener(polygon, 'mouseover', function(e)
- {
- polygon.setOptions(
- {
- fillColor: rgb2hex(255,0,0),
- strokeColor: rgb2hex(0,0,255)
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement