Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Openlayers


Go to End


3 Posts   1380 Views

Avatar
scizmeli

Community Member, 2 Posts

17 November 2009 at 6:44am

Edited: 17/11/2009 6:44am

First of all congratulations for this lovely software. It's the best I came across so far.

I am very very new to Silverstripe (a few days only). Thanks a lot for your patience with me.

I would like to display a map using Openlayers within my Silverstripe. I have a static .html page containing the Openlayers code that correctly displays my map.

My question is : How do I wrap that file so that it all appears as if it is part of Silverstripe?

I read the documentation but still can not figure out how.

thanks
Servet

Avatar
Hamish

Community Member, 712 Posts

17 November 2009 at 8:47am

You'd use it in a template (.ss) file. See the wiki pages about templating:

http://doc.silverstripe.org/doku.php?id=templates

So, for example, you can do:

<% require javascript(mysite/javascript/openlayers.js %>
<% require javascript(mysite/javascript/mappage.js %>
<div id='map'></div>

where mappage.js is all your openlayers scripts for that page.

Avatar
scizmeli

Community Member, 2 Posts

19 November 2009 at 12:48am

Thanks for the fast reply, Hamish. I will look into that.