source: tmcsimulator/trunk/webapps/cptms/js/calloutLayer.js @ 534

Revision 534, 1.5 KB checked in by jdalbey, 6 years ago (diff)

cptms/index.html add callout btn and stub for callout map layer

Line 
1function initCalloutbutton()
2{
3    var calloutBtnDiv = document.getElementById('calloutButton');
4    map.controls[google.maps.ControlPosition.LEFT_BOTTOM].push(calloutBtnDiv)
5    calloutBtnDiv.title = 'Click to toggle Callout Overlay';
6
7    // Setup the click event listeners to toggle icon display
8    calloutBtnDiv.addEventListener('click', function()
9    {
10        callout_showing = !callout_showing;
11        // Determine which button image to show
12        if (callout_showing)
13        {
14            pic = "images/btnDepressed_Callout.png"
15            // It's nice when icons become visible that the messages have been refreshed.
16            showCalloutLayer();
17        }
18        else
19        {
20            pic = "images/btnReady_Callout.png"
21            hideCalloutLayer();
22        }
23        document.getElementById('calloutBtnImg').src = pic;
24
25    });
26  // Define the LatLng coordinates for the polygon's path.
27
28    var triangleCoords =
29    [{ lat: 33.84817790215087, lng: -117.9979705810547 },
30{ lat: 33.80482636349161, lng: -118.02680969238283 },
31{ lat: 33.80482636349161, lng: -117.97531127929689 },
32{ lat: 33.84817790215087, lng: -117.9979705810547 }
33    ];
34  // Construct the polygon.
35  region22 = new google.maps.Polygon({
36    paths: triangleCoords,
37    strokeColor: '#FF0000',
38    strokeOpacity: 0.8,
39    strokeWeight: 2,
40    fillColor: '#FF0000',
41    fillOpacity: 0.35
42  });
43}
44var region22;
45function showCalloutLayer()
46{
47    region22.setMap(map);
48}
49function hideCalloutLayer()
50{
51    region22.setMap(null);
52}
Note: See TracBrowser for help on using the repository browser.