Friday, August 29, 2014

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/

Leaflet

2 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

 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me