Changeset 335 in tmcsimulator for trunk/webapps/js


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

Define clickable region for CMS and CCTV icons.

Location:
trunk/webapps/js
Files:
2 edited

Legend:

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

    r326 r335  
    4343    cctvLayer = new google.maps.Data(); 
    4444    cctvLayer.loadGeoJson(kCCTVfile); 
     45    // Define the clickable area on an icon (the default is too big) 
     46    var clickRegion = {coords: [0,0,14,8], type: "rect"}   
    4547    cctvLayer.setStyle(function(feature) 
    4648    { 
     
    4850        return { 
    4951            icon: makecctvIcon(feature.getProperty("nearVDS")), 
     52            shape: clickRegion, 
    5053            title: feature.getId() + " " +feature.getProperty('locationName'), 
    5154            visible: false   
  • 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.