dimanche 12 février 2017

how to put string in bindpopup in leaflet

Vote count: -1

hi guys having a problem where my leaflet is showing the map and myicon but without string/text inside the popup. Can you help me with this?

this is the code I've managed to have my pop up in my leaflet

var map = L.map( 'map', {
  center: [20.0, 5.0],
  minZoom: 2,
  zoom: 2
})

L.tileLayer( 'http://ift.tt/UdqNor', {
  attribution: '© OpenStreetMap',
 subdomains: ['a', 'b', 'c']
}).addTo( map )

var myURL = jQuery( 'script[src$="leaf-demo.js"]' ).attr( 'src' ).replace( 'leaf-demo.js', '' )

var myIcon = L.icon({
  iconUrl: myURL + 'images/pin24.png',
  iconRetinaUrl: myURL + 'images/pin48.png',
  iconSize: [29, 24],
  iconAnchor: [9, 21],
  popupAnchor: [0, -14]
})


 var markers = [['Roxas',11.58528,122.75111]];
 for ( var i=0; i < markers.length; i++ ){
  marker = L.marker ([markers[i][1], markers[i][2]], {icon: myIcon})
  .bindPopup(markers[i][0])

  .addTo( map );
}

Please can you help me solved it?

asked 28 secs ago

Let's block ads! (Why?)



how to put string in bindpopup in leaflet

Aucun commentaire:

Enregistrer un commentaire