RAGAZZI FINALMENTE MOSTRA I MARKERS, MA, PERCHE' Cè SEMPRE UN MA NON LI MOSTRA TUTTI!
codice:
function addMarker(posizione, titolo,contenuto){
var marker = new google.maps.Marker({
position: posizione,
map: map,
title:titolo });
var infowindow = new google.maps.InfoWindow({content: contenuto});
google.maps.event.addListener(marker, 'click', function() {infowindow.open(map, marker);});
return marker;
}
function geocode(indirizzo,desc,content){
geocoder.geocode( { 'address': indirizzo}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
addMarker(results[0].geometry.location,desc,content);
}
}
);
}
var map;
var geocoder = new google.maps.Geocoder();
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(44.6885,10.6649),
zoom: 9,
mapTypeId: google.maps.MapTypeId.ROADMAP
/*
ROADMAP displays the normal, default 2D tiles of Google Maps.
SATELLITE displays photographic tiles.
HYBRID displays a mix of photographic tiles and a tile layer for prominent features (roads, city names).
TERRAIN displays physical relief tiles for displaying elevation and water features (mountains, rivers, etc.).
*/
};
map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
codice:
<html>
<head>
<jsp:useBean class="beans.Bean" id="gpb"></jsp:useBean>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
#map-canvas { height: 100%;
width: 100%;
border: 0%;
padding: 0%;
}
</style>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="main.js"></script>
<script type="text/javascript">
function addP(){
<%=gpb.getElements()%>
}
</script>
</head>
<body>
<h1 onclick="addP()"><strong><u>Cliccando qui</u> potrete visualizzare le sedi convenzionate con noi!</strong></h1>
<div id="map-canvas"></div>
</body>
</html>
HO CREATO UNA APPOSITA PAGINA JS, COME CONSIGLIATO! NON STO A RIPOSTARE IL CODICE JAVA CHE NON CREA PROBLEMI!
COME POSSO RISOLVERE IL FATTO CHE MOSTRI SOLTANTO DIECI SU CIRCA NOVANTA MARKERS?
GRAZIE DAVVERO A TUTTI PER L'ATTENZIONE CHE MI AVETE DATO FIN DAI PRIMI GIORNI... GRAZIE RAGAZZI