Stephen Goveia
Posts: 0
Joined: Fri May 10, 2013 3:35 pm

Trying to use Leaflet(open source map api) inside a panel?

I have added the Leaflet .js URL to app settings "External Resources". I set the panel as html and added:

On page Load I call some javascript:

var map = L.map('map').setView([51.505, -0.09], 13);

Code: Select all

L.tileLayer('[url=http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png]http://{s}.tile.cloudmade.com/API-key...[/url]', { 
 attribution: 'Map data © [url=http://openstreetmap.org]OpenStreetMap[/url] contributors, [url=http://creativecommons.org/licenses/by-sa/2.0/]CC-BY-SA[/url], Imagery © [url=http://cloudmade.com]CloudMade[/url]', 
 maxZoom: 18 

}).addTo(map);

But when I test all I see is:

Image

any help would be so appreciated!

Love,
SG

Stephen Goveia
Posts: 0
Joined: Fri May 10, 2013 3:35 pm

Trying to use Leaflet(open source map api) inside a panel?

Sorry after "html and added:" I somehow forgot to put this:

SG

Stephen Goveia
Posts: 0
Joined: Fri May 10, 2013 3:35 pm

Trying to use Leaflet(open source map api) inside a panel?

Ugh.. its a simple div id=map div

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Trying to use Leaflet(open source map api) inside a panel?

Hello!

You need to add the code as Run Java Script action.

Stephen Goveia
Posts: 0
Joined: Fri May 10, 2013 3:35 pm

Trying to use Leaflet(open source map api) inside a panel?

Hi Alena! Yeah I do this js is inside the "run java Script" action:

var map = L.map('map').setView([51.505, -0.09], 13);

L.tileLayer('[url=http://{s}.tile.cloudmade.com/API-key]http://{s}.tile.cloudmade.com/API-key[/url]...', {
attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © CloudMade',
maxZoom: 18
}).addTo(map);

Stephen Goveia
Posts: 0
Joined: Fri May 10, 2013 3:35 pm

Trying to use Leaflet(open source map api) inside a panel?

Also why is it everytime I close the IDE my External Resources are removed?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Trying to use Leaflet(open source map api) inside a panel?

Check the console for any errors. This is a 3rd party library.. we don't provide support for it.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Trying to use Leaflet(open source map api) inside a panel?

This could be a bug.. we'll test this.

Stephen Goveia
Posts: 0
Joined: Fri May 10, 2013 3:35 pm

Trying to use Leaflet(open source map api) inside a panel?

Could it be that I need to include the Leaflet CSS link? I am not sure how to go about that however.

Return to “Issues”