• michael lim
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
I added the AccountLocator component from the  Build an Account Geolocation App trailhead project to my Home tab. I was getting an error with Leaflet.js so I moved the map creation code to the accountsLoaded function in AccountMapController.js.

Everything works OK when I first view the Home page, the accountsLoaded function runs one time. I can click refresh over and over and it works OK.
When I click another tab then go back to Home tab, the accountsLoaded function fires two times. This is causing me an error because the second time it tries to create the map that is already there. I get this error:
Uncaught Action failed: c$AccountMap$controller$accountsLoaded [Map container is already initialized.]

I'm using a Winter 17 dev org.

Thanks
Michael


 
I'm passing this challenge, however when I actually test it out by clicking on an account in the account list item, I get this exception: 

"Something has gone wrong. Action failed: c$AccountMap$controller$accountSelected [TypeError: Cannot read property 'reuseTiles' of undefined] Failing descriptor: {c$AccountMap$controller$accountSelected}."

I did some debugging and found that the location and latitude of the account are indeed being capture by my event, so it looks like this might be a problem with the leaflet function map.panTo(). Does anyone know the solution to this issue? Here's my code, although it's exactly the same as the tutorial's.
 
({
    jsLoaded: function(component, event, helper) {

        setTimeout(function() {
            var map = L.map('map', {zoomControl: 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);
        });
    },

    accountsLoaded: function(component, event, helper) {

        // Add markers
        var map = component.get('v.map');
        var accounts = event.getParam('accounts');
        for (var i=0; i<accounts.length; i++) {
            var account = accounts[i];
            var latLng = [account.Location__Latitude__s, account.Location__Longitude__s];
            L.marker(latLng, {account: account}).addTo(map);
        }  
    },

    accountSelected: function(component, event, helper) {
        // Center the map on the account selected in the list
        var map = component.get('v.map');
        var account = event.getParam("account");
        alert(account.Location__Latitude__s + ', ' + account.Location__Longitude__s);
        map.panTo([account.Location__Latitude__s, account.Location__Longitude__s]);
    }
})

 
I was just starting the new Apex Superbadge and as the instructions requested, created a new developer org.  When I try to link Trailhead to that new dev org I get an error saying "You are attempting to log into Trailhead to complete challenges with an org that isn't supported. When you are completing Trailhead hands-on challenges, you cannot use a production or sandbox org. You must use a Developer Edition (DE) org to complete Trailhead challenges."

I verified the org type is Developer org and that the managed package for the badge is installed in this dev org.
I continue getting an error on the Workflow Rule in the Trailhead excercise that says a workflow field update action was not found, but I have created it.  

Challenge not yet complete... here's what's wrong: 
The 'Set Case to Escalated' Workflow field update action was not found.
Create a workflow rule that will update a field.In some instances, a case must automatically escalate. Create a workflow rule that will set the escalated flag and send a task to the case owner, if a case is not closed and its priority is set to High.

Can someone please help me with this? What is the correct formula for the workflow itself? Perhaps the error is in my current formula.
Thanks!