dojo.connect(rampMap.esriMap, 'onMouseOver', function (evt) { isMouseOnMap = true; console.log("On"); }); dojo.connect(rampMap.esriMap, 'onMouseOut', function (evt) { isMouseOnMap = false; console.log("Off"); });
dojo.connect(featureLayer, "onMouseOver", function (evt) { if (isMouseOnMap == true) { clearTimeout(maptipTimer); maptipTimer = setTimeout(function () { mTips.closeDialog(); mTips.showMapTips(evt) }, 1500 ); } else { console.log("MapTips tried to fire off of map"); } });
mTips.showMapTips = function (evt) { if (!rampMap.identifyMode) { console.log("No layer to identify"); return; } else { if (!rampMap.clickMode) { //When the measure is toggled, disable click events for identify tool return; } else { rampMap.esriMap.graphics.clear(); mTips.createMapTip(evt); rampMap.clickMode = true; } } }; /* Create map tips */ mTips.createMapTip = function (evt) { var viewField; var maptipContent = '<ul id="hover_Popup_List">'; if (rampMap.lang == "fr") { viewField = "F1_STATION_NAME"; } else { viewField = "E1_STATION_NAME"; } //Code to create the path to the image var pictureID = evt.graphic.attributes.OBS_NETWORK_1 + evt.graphic.attributes.OBS_NETWORK_2; pictureID = "<img src = './App_Themes/images/MapIconImages/" + pictureID + ".PNG'/>"; //Setup the content for the maptips popup dialog maptipContent += "<li>" + pictureID + " " + evt.graphic.attributes[viewField] + "</li>"; maptipContent += "</ul>"; console.log(evt.pageX); console.log(evt.pageY); mTips.dialog.setContent(maptipContent); dijit.popup.open({ popup: mTips.dialog, x: evt.pageX + 10, y: evt.pageY - 38 }); };
Solved! Go to Solution.