I'm not able to run a simple demo

13 views
Skip to first unread message

Andrea Borruso

unread,
Aug 15, 2011, 5:48:12 AM8/15/11
to ti...@googlegroups.com
Hi all,
I would like to run a simple tile5 test, but I have a white page.
I'm usign the .js file I have in the dist folder of sidelab-tile5-1.0alpha1-0-gf7bc56f.tar.gz file.

I'm sure it's a very stupid error, but I do not see it.

Below you have my code.

Thank you

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>tile5</title>
        <script type="text/javascript" src="js/tile5.cloudmade.js"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <script type="text/javascript">
            var map = new T5.Map('mapContainer');
            map.layer('tiles', 'tile', {
                generator: 'osm.cloudmade',  apikey: 'mykey'
            });
            map.zoom(8).center('-27.4695 153.0201');
        </script>
        <div id="mapContainer" style="height: 350px;width: 350px" />
    </body>
</html>

Damon Oehlman

unread,
Aug 15, 2011, 5:53:13 AM8/15/11
to ti...@googlegroups.com
Tiny thing, but enough to stop everything working.

Make sure the div is in the HTML before the initialization script, e.g:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>tile5</title>
        <script type="text/javascript" src="https://raw.github.com/sidelab/tile5/master/dist/tile5.cloudmade.js"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <div id="mapContainer" style="height: 350px;width: 350px" />
        <script type="text/javascript">
            var map = new T5.Map('mapContainer');
            map.layer('tiles', 'tile', {
                generator: 'osm.cloudmade',  apikey: '7960daaf55f84bfdb166014d0b9f8d41'
            });
            map.zoom(8).center('-27.4695 153.0201');
        </script>
    </body>
</html>

I should probably be more specific about this in the tutorial...

Cheers,
Damon.

-- 
Damon Oehlman
t: DamonOehlman


andy

unread,
Aug 15, 2011, 6:03:41 AM8/15/11
to ti...@googlegroups.com
Hi Damon,

On Mon, Aug 15, 2011 at 11:53 AM, Damon Oehlman <damon....@gmail.com> wrote:
Make sure the div is in the HTML before the initialization script

now it's perfect, thank you! 

--
Andrea Borruso
website: http://blog.spaziogis.it
38° 7' 48" N, 13° 21' 9" E, EPSG:4326
--

"cercare e saper riconoscere chi e cosa,
 in mezzo all’inferno, non è inferno,
e farlo durare, e dargli spazio"

Italo Calvino
Reply all
Reply to author
Forward
0 new messages