MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / createRightMenu

Function createRightMenu

examples/js/plottingPanel/PlotMapPanel.js:58–222  ·  view source on GitHub ↗
(plotMapPanel)

Source from the content-addressed store, hash-verified

56
57
58 function createRightMenu(plotMapPanel){
59 var rMenu = document.createElement("div");
60 rMenu.id = "rMenu";
61 rMenu.style.position= 'absolute';
62 rMenu.style.visibility = 'hidden';
63 rMenu.style.top = '0';
64 rMenu.style.backgroundColor = '#555';
65 rMenu.style.textAlign = 'left';
66
67 var rMenuUl = document.createElement("ul");
68 rMenuUl.style.margin = '0px';
69 rMenuUl.style.padding = '0px';
70
71 var createPlotLayer = document.createElement("li");
72 createPlotLayer.id="createPlottingLayer";
73 createPlotLayer.innerText = resources.text_createBaseLayer;
74 createPlotLayer.style.margin = '1px 0';
75 createPlotLayer.style.padding = '0 5px';
76 createPlotLayer.style.cursor = 'pointer';
77 createPlotLayer.style.backgroundColor = '#cad4e6';
78 createPlotLayer.style.listStyle = 'none outside none';
79 createPlotLayer.onclick = function () {
80 var plottingLayerName = resources.text_baseLayer;
81 var plottingLayer = L.supermap.plotting.plottingLayer(plottingLayerName, serverUrl);
82 plottingLayer.addTo(map);
83
84 hideRightMenu();
85 }
86 rMenuUl.appendChild(createPlotLayer);
87
88 var activePlottingLayer = document.createElement("li");
89 activePlottingLayer.id="activePlottingLayer";
90 activePlottingLayer.innerText = resources.text_active;
91 activePlottingLayer.style.margin = '1px 0';
92 activePlottingLayer.style.padding = '0 5px';
93 activePlottingLayer.style.cursor = 'pointer';
94 activePlottingLayer.style.backgroundColor = '#cad4e6';
95 activePlottingLayer.style.listStyle = 'none outside none';
96 activePlottingLayer.onclick = function () {
97 if(currentSelectedNode != null && currentSelectedNode.type === "PlottingLayer"){
98 var plottingLayers = L.supermap.plotting.getControl().getPlotMapManager().getPlottingLayers();
99 L.supermap.plotting.getControl().getPlotMapManager().setActivePlottingLayer(plottingLayers[currentSelectedNode.tag]);
100 }
101
102 hideRightMenu();
103 }
104 rMenuUl.appendChild(activePlottingLayer);
105
106 var activeChildPlotLayer = document.createElement("li");
107 activeChildPlotLayer.id="activeChildPlotLayer";
108 activeChildPlotLayer.innerText = resources.text_active;
109 activeChildPlotLayer.style.margin = '1px 0';
110 activeChildPlotLayer.style.padding = '0 5px';
111 activeChildPlotLayer.style.cursor = 'pointer';
112 activeChildPlotLayer.style.backgroundColor = '#cad4e6';
113 activeChildPlotLayer.style.listStyle = 'none outside none';
114 activeChildPlotLayer.onclick = function () {
115 if(currentSelectedNode != null && currentSelectedNode.type === "ChildPlottingLayer"){

Callers 1

PlotMapPanel.jsFile · 0.85

Calls 3

hideRightMenuFunction · 0.85
createElementMethod · 0.80
addToMethod · 0.45

Tested by

no test coverage detected