Changeset 335 in tmcsimulator for trunk/webapps/js/cmsLayer.js


Ignore:
Timestamp:
03/19/2019 01:17:33 PM (7 years ago)
Author:
jdalbey
Message:

Define clickable region for CMS and CCTV icons.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/webapps/js/cmsLayer.js

    r334 r335  
    3434    cmsLayer = new google.maps.Data(); 
    3535    cmsLayer.setMap(map); 
    36     cmsLayer.loadGeoJson(kCMSfile);   
     36    cmsLayer.loadGeoJson(kCMSfile); 
     37    // Define the clickable area on a CMS icon (the default is too big) 
     38    var clickRegion = {coords: [0,0,18,15], type: "rect"} 
    3739    cmsLayer.setStyle(function(feature) 
    38     { 
    39         // return the StyleOptions 
    40         return { 
    41             icon: iconCMSidle, 
    42             title: feature.getId()+ " " +feature.getProperty("location")+ " "  
    43                     + feature.getProperty("street"), 
    44             visible: false 
    45         }; 
    46     }); 
     40        { 
     41            // return the StyleOptions 
     42            return { 
     43                icon: iconCMSidle, 
     44                shape: clickRegion, 
     45                title: feature.getId()+ " " +feature.getProperty("location")+ " "  
     46                        + feature.getProperty("street"), 
     47                visible: false 
     48            }; 
     49        }); 
    4750     
    4851    cmsLayer.addListener('click', function(event) 
Note: See TracChangeset for help on using the changeset viewer.