Leaflet TypeError: t is null

There are may be several reasons for TypeError:t is null, but I solved my problem by changing-
 L.marker(LATITUDE,LONGITUDE).bindPopup("Info").addTo(map);  
 to  
 L.marker(L.latLng(LATITUDE,LONGITUDE)).bindPopup("Info").addTo(map);  

 Hope it helps you as well - http://jsfiddle.net/amrana83/fA8JW/4/

Comments

  1. You have to pass an array|L.latLng to L.marker, but you are passing two parameters with example #1 instead. L.marker([lat, lon]) should work as well.

    ReplyDelete
  2. Thanks for your comment Mike!

    ReplyDelete

Post a Comment

Popular posts from this blog

Generate ArcGIS Token By URL Request From ArcGIS Portal, Federated Environment , ESRI JS API and Angular snippets

Update WPF Interaction Triggers in from .Net Framework 4.8 to .Net 5

Solution: IntelliJ not recognizing a particular file correctly, instead its stuck as a text file