<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>Salve ho un problema e me ne sono accorto solo ora e volevo sapere se 
qualcuno mi può dare una mano.</DIV>
<DIV>Sto usando le  mapbox.js versione 1.4 per la gestione delle 
OSM.<BR><BR>Carico la mappa con uno zoom 14.</DIV>
<DIV> </DIV>
<DIV>var map = L.mapbox.map('map', 
'xxxxxxx.map-h6zjbw6j').setView([xx.xxxxxxx,y.yyyyyyy], 14);</DIV>
<DIV>var ico=L.icon({iconUrl:'icone/amenity/1.png', iconSize:[47, 
47],iconAnchor:[25,25],popupAnchor:[0,-15]});</DIV>
<DIV> </DIV>
<DIV>A questo punto uso delle chiamate asincrone per popolare la mappa con i 
punti di interesse</DIV>
<DIV>seguendo l’ esempio <A title=http://leafletjs.com/examples/geojson.html 
href="http://leafletjs.com/examples/geojson.html">http://leafletjs.com/examples/geojson.html</A></DIV>
<DIV> </DIV>
<DIV>function loadLayer(url)</DIV>
<DIV>{</DIV>
<DIV>    CancellaLinea() ;</DIV>
<DIV>            
//myLayer.features([]);</DIV>
<DIV>    InzioLayer=true;</DIV>
<DIV>    myLayer = L.geoJson(url,</DIV>
<DIV>    {</DIV>
<DIV>    onEachFeature:function onEachFeature(feature, layer) 
</DIV>
<DIV>    {</DIV>
<DIV>        </DIV>
<DIV>        </DIV>
<DIV>        if 
(feature.geometry.type!="Point")</DIV>
<DIV>        {</DIV>
<DIV>            
obj=$.geo.centroid(feature.geometry);</DIV>
<DIV>            
layer=L.marker(L.latLng(obj.coordinates[1],obj.coordinates[0]), 
{icon:ico});</DIV>
<DIV>                                     
</DIV>
<DIV>        }</DIV>
<DIV>                
</DIV>
<DIV>        if (feature.properties 
&& feature.properties.name) </DIV>
<DIV>                
{</DIV>
<DIV>                       
//        
layer.bindPopup(feature.properties.name+"<br/><a href='<A 
href="http://www.openstreetmap.org/browse/"+feature.properties["@type"]+"/"+feature.properties["@id"]+"'">http://www.openstreetmap.org/browse/"+feature.properties["@type"]+"/"+feature.properties["@id"]+"'</A>>Guarda 
su OSM</a>");</DIV>
<DIV>                        
layer.bindPopup("<div 
class=\"marker-title\">"+feature.properties.name+"</div>"</DIV>
<DIV>                            
+"<br/><div 
class=\"marker-description\">"+feature.properties.description</DIV>
<DIV>                            
+"</div>");</DIV>
<DIV>        }</DIV>
<DIV>    },</DIV>
<DIV>    pointToLayer: function (feature, latlng) </DIV>
<DIV>    {    </DIV>
<DIV>        
ico=L.icon({iconUrl:feature.properties.icon.iconUrl, 
iconSize:[feature.properties.icon.iconSize],iconAnchor:[0,-25]});</DIV>
<DIV>    </DIV>
<DIV>    var marker=L.marker(latlng, {icon:ico});</DIV>
<DIV>    return marker;</DIV>
<DIV>    }</DIV>
<DIV>    });</DIV>
<DIV>    myLayer.addTo(map);</DIV>
<DIV>    myLayer.on('mouseover', function(e) {</DIV>
<DIV>   // e.layer.openPopup();</DIV>
<DIV>});</DIV>
<DIV>myLayer.on('mouseout', function(e) {</DIV>
<DIV>   // e.layer.closePopup();</DIV>
<DIV>});</DIV>
<DIV>                
myLayer.on('click', function(e) {</DIV>
<DIV>        
map.panTo(e.layer.getLatLng());</DIV>
<DIV>       </DIV>
<DIV>    });</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>E i punti di interesse compaiono sulla mappa con le relative 
dialogbox.</DIV>
<DIV> </DIV>
<DIV>Il problema è che i punti risultano essere nella posizione giusta solo al 
massimo zoom mentre a zoom più alti traslano e si trovano fuori 
posizione.<BR>Qualcuno sa dove posso avere sbagliato o se manca una funzione che 
relativizza la posizone a seconda dello zoom ?</DIV>
<DIV> </DIV>
<DIV>Grazie in anticipo</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></DIV></DIV></BODY></HTML>