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
Pratik Gangawane 7Pratik Gangawane 7 

Aura Specialist SuperBadge - Issue with Step 10.

 Facing issue while saving Map.cmp as "Failed to save Map.cmp: resource Leaflet cannot be found in namespace .: Source". while completing challenge 10 for Aura specialist. Any help on the same will be apprec
component code is: 

Map.cmp
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
    
    <aura:attribute name="width"  type="String" default="100%" />
    <aura:attribute name="height" type="String" default="200px" />
    <aura:attribute name="location" type="SObject"/>
    <aura:attribute name="jsLoaded" type="boolean" default="false"/>
    
    <ltng:require styles="{!$Resource.Leaflet + '/leaflet.css'}" 
                  scripts="{!$Resource.Leaflet + '/leaflet-src.js'}"
                  afterScriptsLoaded="{!c.jsLoaded}" /> 

    <aura:handler event="c:PlotMapMarker" action="{!c.onPlotMapMarker}"/>
                  
    <lightning:card aura:id="map" title="Current Boat Location">
        <div style="{!'width: ' + v.width + '; height: ' + v.height}">
            <div style="width:100%; height:100%" class="slds-align_absolute-center">Please make a selection</div>
        </div>
    </lightning:card>
    
</aura:component>

MapController.js
({
    jsLoaded: function(component) {
        component.set("v.jsLoaded", true);
    },
    onPlotMapMarker: function (component,event,helper) { 
            var location = component.get("v.location");
        var locationData = {
            sObjectId : event.getParam("sObjectId"),
            lat : event.getParam("lat"),
            long : event.getParam("long"),
            label : event.getParam("label")
        };
        component.set("v.location", locationData);
    }   
})
Pratik Gangawane 7Pratik Gangawane 7
Just got the answer for the same.
replace line of code in
Map.cmp
 <ltng:require styles="{!$Resource.Leaflet + '/leaflet.css'}" 
                  scripts="{!$Resource.Leaflet + '/leaflet-src.js'}"
                  afterScriptsLoaded="{!c.jsLoaded}" /> 

with the following

 <ltng:require styles="/resource/leaflet/leaflet/leaflet.css" 
                  scripts="/resource/leaflet/leaflet/leaflet.js"
                  afterScriptsLoaded="{!c.jsLoaded}" />  
and go for the superbadge :)