You need to sign in to do that
Don't have an account?

Build an Account Geolocation App - Error despite completing the trail
Hello developers
Need to admit that I have no developer knowledge and I thought that this "project" was a good idea...
Despite the project showing as complete in trailhead I have encountered the following error.
The trailhead section - use events to center the app is working when it is running on the browser but when I include the click event handler to the markers
Uncaught TypeError: Cannot read property 'setParams' of undefined throws at https://cunning-otter-goe27l-dev-ed.lightning.force.com/c/components/c/AccountMap.js:40:15
While if I open the tab in the salesforce 1 and salesforce I receive the below error
Error in $A.getCallback() [helper.reportErrorSafely is not a function]
Object.loadContent()@https://cunning-otter-goe27l-dev-ed.lightning.force.com/components/laf/pageHost.js:18:417
Object.eval()@https://cunning-otter-goe27l-dev-ed.lightning.force.com/components/laf/pageHost.js:14:374
Any help will be much appreciated
With regards
Dimitrios
Need to admit that I have no developer knowledge and I thought that this "project" was a good idea...
Despite the project showing as complete in trailhead I have encountered the following error.
The trailhead section - use events to center the app is working when it is running on the browser but when I include the click event handler to the markers
L.marker(latLng, {account: account}).addTo(map).on('click', function(event) { helper.navigateToDetailsView(event.target.options.account.Id); }); Thus changing the AccountMapControler from ({ 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); }, 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"); map.panTo([account.Location__Latitude__s, account.Location__Longitude__s]); } }) To the following ({ 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); }, 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).on('click', function(event) { helper.navigateToDetailsView(event.target.options.account.Id); }); } }, 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"); map.panTo([account.Location__Latitude__s, account.Location__Longitude__s]); } })When clicking on a marker from within the web browser tab from where I am running the application, I receive the following error
Uncaught TypeError: Cannot read property 'setParams' of undefined throws at https://cunning-otter-goe27l-dev-ed.lightning.force.com/c/components/c/AccountMap.js:40:15
While if I open the tab in the salesforce 1 and salesforce I receive the below error
Error in $A.getCallback() [helper.reportErrorSafely is not a function]
Object.loadContent()@https://cunning-otter-goe27l-dev-ed.lightning.force.com/components/laf/pageHost.js:18:417
Object.eval()@https://cunning-otter-goe27l-dev-ed.lightning.force.com/components/laf/pageHost.js:14:374
Any help will be much appreciated
With regards
Dimitrios
ERROR WHEN TESTING FOR TRAILHEAD: BUILD AN ACCOUNT GEOLOCATION APP
All Answers
ERROR WHEN TESTING FOR TRAILHEAD: BUILD AN ACCOUNT GEOLOCATION APP
I runned a Google Search for - Error when testing for Trailhead: Build an Account Geolocation App
Went through the first post - https://developer.salesforce.com/forums/?id=9060G0000005gDwQAI
Which suggest to clear cookies - clear cache and the thing worked as charm...