function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NanduNandu 

Map container not found

User-added image
Component
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    <aura:attribute name="map" type="Object"/>
   <ltng:require 
        styles="{!$Resource.mahesh_space__leaflet + '/leaflet.css'}"
        scripts="{!$Resource.mahesh_space__leaflet + '/leaflet.js'}"
        afterScriptsLoaded="{!c.jsLoaded}" />
    
     <!--<ltng:require 
                  styles="{!$Resource.mahesh_space__leaflet + '/leaflet.css'}"
                  scripts="{!join($Resource.mahesh_space__leaflet + '/leaflet.js', 
                           $Resource.mahesh_space__leaflet + '/leaflet-src.js')}"
                  afterScriptsLoaded="{!c.jsLoaded}" />-->
    <lightning:card>
        <div aura:id="map" style="width:100%;hieght:100%">
        </div>
    </lightning:card>
</aura:component>

Controler
({
    jsLoaded: function(component, event, helper) {
        var map = L.map('map', {zoomControl: false, tap: false}).setView([37.784173, -122.401557], 14);
        L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',
                    {
                        attribution: 'Tiles © Esri'
                    }).addTo(map);
        component.set("v.map", map);
    }
})