Ho difficoltà a cercare di aggiungere un semplice indicatore selezionabile a un ArcGIS, mappare semplicemente utilizzando JavaScript. Tutti gli ArcGIS Samples sembrano ottenere il loro indicatore e le relative informazioni popup dal server. Come posso ottenere lo stesso risultato con ArcGIS come questo codice di esempio di Google Maps di seguito?Esempio semplice di ArcGIS che riproduce dinamicamente un marker
<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>
Sembra funzionare bene per me: http://jsfiddle.net/j08691/DLAsJ/. Riceverò la taglia;) – j08691
@ j08691 hai inserito il mio codice in jsfiddle ... non hai usato ArcGIS, come richiesto dalla mia domanda. – Langdon