Google Maps API, feeding an API into an InfoWindow

I am working on a project for college, this project is a Web application Mashup,it must include 2 API's, I am using the "StatsFc" & "Google Maps" API's, Both the API's are pretty easy to understand and use bar one issue I am having.

in order to feed in the next match fixtures for a specific football team they tell you to use this code:

<!-- Place in the <head> of your page -->
   <script src="//code.jquery.com/jquery-latest.min.js"></script>
   <link rel="stylesheet" href="//api.statsfc.com/widget/next-fixture.css">
   <script src="//api.statsfc.com/widget/next-fixture-1.0.min.js"></script>

   <!-- Place in the <body> of your page -->
   <div id="statsfc-next-fixture"></div>

   <!-- Place just before the closing </body> tag -->
     <script>
      var nextFixture = new StatsFC_NextFixture('API_KEY');
      nextFixture.team = 'Liverpool';
      nextFixture.display('statsfc-next-fixture');
      </script>

I have followed that perfect and it works flawless when in any of the divs on the page except the one I have inside the google maps Info Window:

This is the section for the maps, now whaen the code is ran the is been displayed but the API information isnt been fed into the div

 function initialize() {
    var myLatlng = new google.maps.LatLng(53.4302988,-2.9616045);
     var mapOptions = {
      zoom: 4,
       center: myLatlng
     };

   var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

   var contentString = '<div id="siteNotice">'+
 '<div id="statsfc-next-fixture">'+

  '</div>'+
  '</div>';

  var infowindow = new google.maps.InfoWindow({
     content: contentString
    });

I dont understand this an awful lot so I apologize in advanced for my bad explanation, i am also unaware if this is possible to do, so please an help or information would be greatly appreciated. If you have any further questions just ask, thank you so much

James


  • make sure you only have one div with the id="statsfc-next-fixture" on the page

  • remove from the bottom of the page

    <script>
      var nextFixture = new StatsFC_NextFixture('API_KEY');
      nextFixture.team = 'Liverpool';
      nextFixture.display('statsfc-next-fixture');
      </script>
    
  • add to the end of your initialize function

    var nextFixture = new StatsFC_NextFixture('API_KEY'); nextFixture.team = 'Liverpool'; nextFixture.display('statsfc-next-fixture');

  • If this doesn't work I have a few more ways that you can do this ...

    链接地址: http://www.djcxy.com/p/35868.html

    上一篇: 我如何获得谷歌字体API密钥

    下一篇: Google Maps API,将API提供给InfoWindow