Internet Radio
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
Like Tree2Likes

Thread: HTML Code for Embedding Google Maps for Radio Listeners

  1. #1
    Support's Avatar
    Support is offline Support
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,318

    World HTML Code for Embedding Google Maps for Radio Listeners

    With the following code you can embed a live google map of where your listeners are located in your own website. A very cool feature.

    See Demo Here

    There are a couple of things that need to modified in the code below to enable this to work :

    1. Google Maps API Key.
    Register for a google maps API key from here : Sign Up for the Google Maps API - Google Maps API - Google Code
    Replace the key= field in the html with your key otherwise it wont work.

    2. Server URL
    You must replace the server url (listed below as shoutcast.internet-radio.com) with your particular servers URL (found in the welcome email).

    3. Replace the USERNAMEHERE with your username.

    4. Modify the 'style="width: 1030px; height: 680px"' dimensions to fit your page.

    HTML Code:
    <html>
    <head>
    </head>
    <body>
            
    <div id="cc_google_maps" style="width: 1030px; height: 680px"></div>
    
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA879TPvre-L5Fh_lmVFINJxT-4l_MyznJ06qBtn-fiJT7vPkvpRQhTEpvNYfckzp-A-2Fux6cd4NlLw" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="http://shoutcast.internet-radio.com/system/googlemaps.js"></script>
    <script language="javascript" type="text/javascript" src="http://shoutcast.internet-radio.com/js.php/USERNAMEHERE/googlemaps/rnd0"></script>
    
    <script type="text/javascript">
    if (!window.onload) window.onload = cc_googlemaps_initialize;
    </script>
    
    </body>
    </html>
    This should enable you to have a smart looking map of your live listeners on your website. The accuracy of the map is to city level too.

  2. #2
    rollinradio is offline Regular
    Join Date
    Jul 2009
    Posts
    48

    Default Google Maps

    Great stuff support, I will be on the case later and post how it goes !

  3. #3
    rollinradio is offline Regular
    Join Date
    Jul 2009
    Posts
    48

    Default Google maps

    Hi support I cant find my welcome email with that url in it ?

    Any chance you can post it on here so I can get this google map up !

    Pretty please :p

    I have my map key very easy to set up just need this url to replace shoutcast.internet-radio.com.

    Was thinking i could use http://84.16.251.251:10226 ? ? not sure so asking the experts lol

    |Rollinradio

  4. #4
    Support's Avatar
    Support is offline Support
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,318

    Default

    Hi Rollin

    In your case leave it as it is (shoutcast.internet-radio.com) Thats the server your on. Some people are on cp.internet-radio.com so they would need to change it

  5. #5
    rollinradio is offline Regular
    Join Date
    Jul 2009
    Posts
    48

    Default Map Embedding

    Hi Support,

    I have got my API key and replaced it in the html but to no joy I cant get the map to display anything.
    Can you try this code incase it's something my end not working, I notice in your code the api key has - _ in it ?

    My API key was just a long string of letters and numbers.

    <html>
    <head>
    </head>
    <body>

    <div id="cc_google_maps" style="width: 720px; height: 550px"></div>

    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA2DZnMF8xGPOa GL7ZbH3NLhRP7BOxTiqaLYprEIEHk8yJgJcDihReSpiQsz2kgn TO9XpEm3oo3jbjRA"type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="http://shoutcast.internet-radio.com/system/googlemaps.js"></script>
    <script language="javascript" type="text/javascript" src="http://shoutcast.internet-radio.com/js.php/USERNAMEHERE/googlemaps/rnd0"></script>

    <script type="text/javascript">
    if (!window.onload) window.onload = cc_googlemaps_initialize;
    </script>

    </body>
    </html>

  6. #6
    DiscoDave is offline Veteran Member
    Join Date
    Apr 2009
    Location
    Galashiels
    Posts
    162

    Default

    I'm confused a bit here - how does Google know which stream to look at? There's nothing in there with the station username or anything..?
    TD1 Radio
    Community Radio from Galashiels
    http://www.td1radio.com

  7. #7
    rollinradio is offline Regular
    Join Date
    Jul 2009
    Posts
    48

    Default Google maps

    Yeah i was thinking that surely it needs to know the server and port ?

    Anyway cant it to display anything so hopefully support can shed some light on the issue.
    RollinRadio


  8. #8
    Support's Avatar
    Support is offline Support
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,318

    Default

    Very good point Dave, well spotted! My bad. I forgot to mention that the username needs to be entered. I have modified my above code to include USERNAMEHERE. Replace this with your own. I previously had it set to a test account. Apologies. Let us know how you get on.

    Heres some proof of concept html :

    http://shoutcast.internet-radio.org....psexample.html

  9. #9
    rollinradio is offline Regular
    Join Date
    Jul 2009
    Posts
    48

    Default Google map

    Hi all again,

    I still cant get any map showing even waited a few hours incase the api key took a while to register with google !

    Out of interest you show this as html just to check this is not php script is it ? as I know from previous experience php just will not work with my site.

    All my site is based on html and flash.

    any idea's anyone ?
    RollinRadio

  10. #10
    Support's Avatar
    Support is offline Support
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,318

    Default

    Its just HTML + Javascript. Can you send us a link to your page where you have the code so we can have a look ? Might be handy for diagnosing the issue.

    Also out of interest has anybody else got this to work on their own sites ?

Page 1 of 4 123 ... LastLast

LinkBacks (?)

  1. 9th February 2010, 11:47 AM
  2. 16th August 2009, 08:22 PM
  3. 16th August 2009, 12:37 AM
  4. 13th August 2009, 12:50 AM
  5. 9th August 2009, 11:51 PM
  6. 4th August 2009, 09:05 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •