Geo map javascript not working

When I’m trying to run the tutorial code for injecting javascript, it doesn’t seem to be working. After some checking, I think the issue is, for some reason it doesn’t find the leaflet map object. The code runs though, but doesn’t do anything without the map. The default map is working, but I can’t do any customization due to this error. I have tried it in opera and chrome, same results. If I log ‘mymap’ variable to the console, this is the result: image
The tutorial mentioned: Geographical Maps Custom Region - Helical Insight

Hi Papp,
May I know what are you trying to accomplish?

Note that we already have built UI driven map customization options which can be used for achieving a lot of things and it might happen that you might not need to use JScode all together

Can you please go through this link to learn more

Please let us know in case of any more questions

Hello,
I wanted to fill up the map with polygons from a geoJSON file, and I think I can’t do that with the customization features presented. Is there any way to fix the issue I’m having? Thank you in advance,
Papp Márton