ContextMenuControl.js

ContextMenuControl()


constructor

ContextMenuControl class is responsible for displaying a context menu when right clicking on the map. Controls should be added using Map

Options:
  • offset(Array)The offset in pixels from the control's original position (default: [0, 0])
Parameter Type Description
options Object The options of the control.

Example

var theMap  = null;
$(document).ready(function(){

    var mapContainer = T.DomUtil.get("map"),
        mapoLayer = new T.TibcoLayer();

    theMap = new T.Map(
        mapContainer,					
        {
            zoom: 3, 
            center: new T.LatLng(46, 2),
            controls: {
                contextMenu: {
                    //addToMap: false
                },
                attribution: {
                    prefix: "<a href=''>©TIBCO</a>"
                }
            }						
        }
    );								

    theMap.addLayer(mapoLayer);
});
<!DOCTYPE html>
<html>    
    <head>
        <title>TibcoMaps - Context Menu Control</title>
        <meta charset="UTF-8">

        <!-- CSS -->
        <link rel="stylesheet" href="context-menu.css">
        <link rel="stylesheet" type="text/css" href='../lib/GeoAnalytics.css'>

        <!-- Javascript -->
        <script type="text/javascript" src='../lib/GeoAnalytics.js'></script>
        <script type="text/javascript" src='../lib/jquery-1.9.1.min.js'></script>	
        <script type="text/javascript" src="context-menu.js"></script>		
       
    </head>

    <body>
        <div class="custom-container">
            <div id="map"></div>
        </div>
    </body>
</html>
body, html { 
    height: 100%;
    width: 100%;
    margin: 0px;
}

.custom-container  {
    position: absolute;
    top: 0px;
    bottom: 0px;
    left: 0px;
    right: 0px;   
}

#map {			
    width: 100%;
    height: 100%;
}