map.infoWindow.setFeatures([gmarkers[index]]); map.infoWindow.show(gmarkers[index].geometry);
map.infoWindow.hide(); map.infoWindow.resize(475,400); map.infoWindow.setTitle(title); map.infoWindow.setContent(tc.domNode); map.infoWindow.setFixedAnchor(esri.dijit.InfoWindow.ANCHOR_UPPERRIGHT); var maxPoint = new esri.geometry.Point(map.extent.xmax, map.extent.ymax); var centerPoint = new esri.geometry.Point(map.extent.getCenter()); var maxPointScreen = map.toScreen(maxPoint); var centerPointScreen = map.toScreen(centerPoint); var xDiff = Math.abs(maxPointScreen.x - evt.screenPoint.x) - 505; var yDiff = Math.abs(maxPointScreen.y - evt.screenPoint.y) - 485; if (xDiff < 0) {centerPointScreen.x -= xDiff;} if (yDiff < 0) {centerPointScreen.y += yDiff;} centerPoint = map.toMap(centerPointScreen); map.centerAt(centerPoint); map.infoWindow.show(evt.screenPoint, esri.dijit.InfoWindow.ANCHOR_UPPERRIGHT);
function reveal_site(i) { var split = i.split(','); var index = split[0]; var latitude = split[1]; var longitude = split[2]; if(index) { point = new esri.geometry.Point(longitude,latitude,new esri.SpatialReference({ wkid: 4326 })); point = esri.geometry.geographicToWebMercator(point); map.infoWindow.setTitle(gmarkers[index].getTitle()); map.infoWindow.setContent(gmarkers[index].getContent()); map.infoWindow.show(point, point); } }
function initializeCruises() { var content = ""; var count = 1; for (var j=0;j<dataLayer.graphics.length;j++) { graphic = dataLayer.graphics; var xPt = graphic.attributes.x; var yPt = graphic.attributes.y; var id = graphic.attributes.id; var region = graphic.attributes.region; var cruise = graphic.attributes.cruise; var dates = graphic.attributes.dates; content += "<li style='background-color: #0000ff;color: #ffffff;' onclick='showCruise("+id+");'onmouseover='highlightCruise("+xPt+","+yPt+");'onmouseout='highlightLayer.clear();'><b>"+(count)+")</b> "+region+" - Cruise "+cruise+"<br/>("+dates+")</li>"; count++; } dojo.byId("itemsList").innerHTML = content; } // highlights a cruise on the map from the listing in the right pane function highlightCruise(xPt,yPt) { var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 25, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 255, 0]), 3.5), new dojo.Color([0, 255, 0, 0.0])); var geometry = new esri.geometry.Point(xPt, yPt); geometry = esri.geometry.geographicToWebMercator(geometry); highlightLayer.add(new esri.Graphic(geometry, symbol)); }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.