Adding basic map example on Django/leaflet framework

1 post / 0 new
luigi0229
Adding basic map example on Django/leaflet framework

Hello all,

I am using the django framework with a leaflet plugin. Unfortunately, one of the only ways to summon a Map using django/leaflet is by calling a JS init callback function upon creating it
({% leaflet_map "mymap" callback="window.map_init_basic" %}). Now, in order to get mapquest to work, i have to implement it inside this init JS function, but i can't seem to do that. Seems like the map is already initialized and i can't initialize it again the way it is on the sample code. When i try to add layers to the existing one, it fails adding the last layer. My question is, how would i be able to implement the sample code inside a function just like the one below?

<script type="text/javascript">
function map_init_basic (map, options) {

     ///MAPQUEST code here

}
</script>

 

Thanks in advance.

-Eli