Grazie stasera ci do un occhio<br><br>"sabas88 [via GIS]" <<a href="/user/SendEmail.jtp?type=node&node=5783585&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> ha scritto:<br><br>

        <div dir="ltr">Ciao,<div>per queste domande abbiamo creato la lista degli sviluppatori<div><div><a href="https://lists.openstreetmap.org/listinfo/dev-italia" target="_top" rel="nofollow" link="external">https://lists.openstreetmap.org/listinfo/dev-italia</a><br></div>

</div></div><div><br></div><div>Ad occhio sembra che usi jsonp..</div><div><br></div><div>Io ho fatto direttamente con Leaflet (Mapbox.js è un plugin di Leaflet adesso..) ed una piccola funzione per fare la chiamata ajax, trovi il codice qua</div>

<div><a href="https://github.com/sardinia-opendata/Open-Nuraghe" target="_top" rel="nofollow" link="external">https://github.com/sardinia-opendata/Open-Nuraghe</a><br></div><div><br></div><div>Ciao,</div><div>Stefano</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">

2013/11/1 akstern <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=5783583&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>></span><br>

Salve vorrei implementare una mappa in cui i punti di interesse venissero<br>
richiamati tramite una chiamata ajax in formato json.<br>
Ho cercato di modificare il codice all' indirizzo<br>
<a href="https://www.mapbox.com/mapbox.js/example/v1.0.0/custom-marker-tooltip/" target="_blank" rel="nofollow" link="external">https://www.mapbox.com/mapbox.js/example/v1.0.0/custom-marker-tooltip/</a><br>
<br>
Cercando di popolare la viabile geoJson  con l achiamata<br>
getJSON ma anche se il debug mi fa vedere di avere caricato i valori<br>
alla fine non viene visualizzato nulla .<br>
<br>
<br>
   $(".poi_a").bind("click", (function (e) {<br>
<br>
   var indirizzo = $(this).attr("href");<br>
   var geoJson = [];<br>
   $.ajaxSetup({ cache: false });<br>
<br>
   $.getJSON('poi.php?callback=?', function(data){<br>
<br>
<br>
            /* loop through array */<br>
           // alert(data);<br>
        }).error(function(jqXHR, textStatus, errorThrown){ /* assign handler<br>
*/<br>
            /* alert(jqXHR.responseText) */<br>
           alert("error occurred!");<br>
        })<br>
        .done(function() {<br>
alert( "second success" );<br>
  //geoJson = data;<br>
<br>
<br>
<br>
   map.markerLayer.setGeoJSON(geoJson);<br>
<br>
    // Cycle through markers once geoJson is ready.<br>
    // Add custom popups to each using our custom feature properties<br>
    map.markerLayer.eachLayer(function(marker) {<br>
<br>
        var feature = marker.feature;<br>
<br>
        // Create custom popup content<br>
        var popupContent =  ' ' +<br>
                                ' <' + feature.properties.url + '>  <' +<br>
feature.properties.image + '> ' +<br>
                            '<br>
' + feature.properties.city + '<br>
' +<br>
                            ' ';<br>
<br>
        // <a href="http://leafletjs.com/reference.html#popup" target="_blank" rel="nofollow" link="external">http://leafletjs.com/reference.html#popup</a><br>
        marker.bindPopup(popupContent,{<br>
            closeButton: false,<br>
            minWidth: 300<br>
        });<br>
    });<br>
<br>
    map.setView([45.908, -78.525], 5);<br>
  })<br>
  .fail(function() {<br>
   alert( "error" );<br>
  })<br>
  .always(function() {<br>
    //alert( "complete" );<br>
<br>
<br>
<br>
  })<br>
        ;<br>
<br>
return false;<br>
<br>
<br>
}));<br>
<br>
});<br>
<br>
la callback ajax è questa<br>
jQuery19101373158977366984_1383292934356(<br>
{<br>
        type: "Feature",<br>
        "geometry": { "type": "Point", "coordinates": [-77.03, 38.90]},<br>
        "properties": {<br>
            "image":<br>
"<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/DCmontage4.jpg/250px-DCmontage4.jpg" target="_blank" rel="nofollow" link="external">http://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/DCmontage4.jpg/250px-DCmontage4.jpg</a>",<br>


            "url": "<a href="http://en.wikipedia.org/wiki/Washington,_D.C" target="_blank" rel="nofollow" link="external">http://en.wikipedia.org/wiki/Washington,_D.C</a>.",<br>
            "marker-symbol": "star",<br>
            "city": "Washington, D.C."<br>
        }<br>
    }, {<br>
        type: "Feature",<br>
        "geometry": { "type": "Point", "coordinates": [-87.63, 41.88]},<br>
        "properties": {<br>
            "image":<br>
"<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Chicago_montage.jpg/300px-Chicago_montage.jpg" target="_blank" rel="nofollow" link="external">http://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Chicago_montage.jpg/300px-Chicago_montage.jpg</a>",<br>


            "url": "<a href="http://en.wikipedia.org/wiki/Chicago" target="_blank" rel="nofollow" link="external">http://en.wikipedia.org/wiki/Chicago</a>",<br>
            "city": "Chicago"<br>
        }<br>
    }, {<br>
        type: "Feature",<br>
        "geometry": { "type": "Point", "coordinates": [-74.00, 40.71]},<br>
        "properties": {<br>
            "image":<br>
"<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/NYC_Montage_2011.jpg/275px-NYC_Montage_2011.jpg" target="_blank" rel="nofollow" link="external">http://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/NYC_Montage_2011.jpg/275px-NYC_Montage_2011.jpg</a>",<br>


            "url": "<a href="http://en.wikipedia.org/wiki/New_York_City" target="_blank" rel="nofollow" link="external">http://en.wikipedia.org/wiki/New_York_City</a>",<br>
            "city": "New York City"<br>
        }<br>
    })<br>
<br>
qualcuno mi può dare una mano ?<br>
Grazie<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gis.19327.n5.nabble.com/mapbox-js-vs-ajax-JSON-tp5783576.html" target="_blank" rel="nofollow" link="external">http://gis.19327.n5.nabble.com/mapbox-js-vs-ajax-JSON-tp5783576.html</a><br>
Sent from the Italy General mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Talk-it mailing list<br>
<a href="/user/SendEmail.jtp?type=node&node=5783583&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a><br>
<a href="https://lists.openstreetmap.org/listinfo/talk-it" target="_blank" rel="nofollow" link="external">https://lists.openstreetmap.org/listinfo/talk-it</a><br>
</blockquote></div><br></div>
<br />_______________________________________________
<br/>Talk-it mailing list
<br/><a href="/user/SendEmail.jtp?type=node&node=5783583&i=2" target="_top" rel="nofollow" link="external">[hidden email]</a>
<br/><a href="https://lists.openstreetmap.org/listinfo/talk-it" target="_top" rel="nofollow" link="external">https://lists.openstreetmap.org/listinfo/talk-it</a><br/>

        
        
        
        <br/>
        <br/>
        <hr noshade="noshade" size="1" color="#cccccc" />
        <div style="color:#444; font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://gis.19327.n5.nabble.com/mapbox-js-vs-ajax-JSON-tp5783576p5783583.html" target="_top" rel="nofollow" link="external">http://gis.19327.n5.nabble.com/mapbox-js-vs-ajax-JSON-tp5783576p5783583.html</a>
        </div>
        <div style="color:#666; font: 11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from mapbox.js vs ajax JSON, <a href="" target="_top" rel="nofollow" link="external">click here</a>.<br/>
                <a href="http://gis.19327.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_top" link="external">NAML</a>
        </div>

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://gis.19327.n5.nabble.com/mapbox-js-vs-ajax-JSON-tp5783576p5783585.html">Re: mapbox.js vs ajax JSON</a><br/>
Sent from the <a href="http://gis.19327.n5.nabble.com/Italy-General-f5324174.html">Italy General mailing list archive</a> at Nabble.com.<br/>