単純なクリック可能なマーカーをArcGISに追加しようとしています。 ArcGIS Samplesはすべて、マーカーと関連するポップアップ情報をサーバーから取得しているようです。 以下のGoogle Mapsサンプルコードと同じ結果をArcGISでどのように達成できますか?ArcGISの単純な例マーカーを動的にレンダリングする
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<div id="map" style="width: 500px; height: 500px;"></div>
<script type="text/javascript">
window.onload = function() {
var myOptions = {
zoom: 2,
center: new google.maps.LatLng(40, -75),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"), myOptions);
var icon = new google.maps.MarkerImage("http://cinnamonthoughts.org/wp-content/uploads/2010/01/Custom-Marker-Avatar.png");
var markerOptions = {
icon: icon,
map: map,
position: new google.maps.LatLng(37.7699298, -122.4469157),
};
var marker = new google.maps.Marker(markerOptions);
google.maps.event.addListener(marker, 'click', function() {
var infoWindow = new google.maps.InfoWindow();
infoWindow.setContent("hello world");
infoWindow.open(map, marker);
});
};
</script>
私のためにうまく動作するようです:http://jsfiddle.net/j08691/DLAsJ/私は賞品を手に入れますか) – j08691
@ j08691あなたはjsfiddleに自分のコードを入れました...私の質問には、ArcGISを使用していませんでした。 – Langdon