Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    6
    Member #
    36231
    Hello everyone!

    I just started a small project and i wanted to use google maps along with it. I made a test page and got google maps to work just fine, but once I tried implementing it to my project, it doesn't work and i'm not sure why.

    I've deleted several lines of code and nothing seems to be working. Starting to think it's because I'm using a resposnive theme website that it won't load google maps.

    Any advice is greatly appreciated.

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    What's the site, dude?
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Junior Member
    Join Date
    May 2013
    Posts
    6
    Member #
    36231
    Oh ... i'm sorry ... um ... should I post the Code? or something?

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Post a link to the site itself.

    I can tell you, thought, that a responsive design by itself will have no bearing on a Google map.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  6. #5
    Junior Member
    Join Date
    May 2013
    Posts
    6
    Member #
    36231
    This is what i been working with the last few days, still haven't gotten the map to load.

    Code:
    <!DOCTYPE html>
    <!-- HTML5 Mobile Boilerplate -->
    <!--[if IEMobile 7]><html class="no-js iem7"><![endif]-->
    <!--[if (gt IEMobile 7)|!(IEMobile)]><!-->
    <html class="no-js" lang="en">
    <!--<![endif]-->
     
    <!-- HTML5 Boilerplate -->
    <!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
    <!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8" lang="en"><![endif]-->
    <!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="no-js" lang="en">
    <!--<![endif]-->
     
    <head>
    <meta charset="utf-8">
     
    <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Magic Finder</title>
    <meta name="description" content="Find a magic game easily!">
    <meta name="keywords" content="Magic The Gathering, Trading Card Game, MTG, TCG, web design">
    <meta name="author" content="Augusto Garcia">
    <meta http-equiv="cleartype" content="on">
    <link rel="shortcut icon" href="/favicon.ico">
     
    <!-- Responsive and mobile friendly stuff -->
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700' rel='stylesheet' type='text/css'>
     
    <!-- Stylesheets -->
    <link rel="stylesheet" href="css/html5reset.css" media="all">
    <link rel="stylesheet" href="css/responsivegridsystem.css" media="all">
    <link rel="stylesheet" href="css/col.css" media="all">
    <link rel="stylesheet" href="css/responsiveslides.css">
     
    <!-- Responsive Stylesheets -->
    <link rel="stylesheet" media="only screen and (max-width: 1024px) and (min-width: 769px)" href="/css/1024.css">
    <link rel="stylesheet" media="only screen and (max-width: 768px) and (min-width: 481px)" href="/css/768.css">
    <link rel="stylesheet" media="only screen and (max-width: 480px)" href="/css/480.css">
     
    <!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements and feature detects -->
    <script
    src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCXB10peXuvlVOaYum_29bdmSmSFqIgHto&sensor=false">
    </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script src="js/modernizr-2.5.3-min.js"></script>
    <script src="js/responsive-nav.js"></script>
     
    <script>
    function initialize()
    {
    var mapProp = {
      center:new google.maps.LatLng(51.508742,-0.120850),
      zoom:5,
      mapTypeId:google.maps.MapTypeId.ROADMAP
      };
    var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
    }
     
    google.maps.event.addDomListener(window, 'load', initialize);
    </script>
       
        <style type="text/css">
    html {height:100%}
    body {height:100%;margin:0;padding:0}
    #googleMap {height:100%}
    </style>
       
    </head>
     
    <body>
    <div id="skiptomain"><a href="#maincontent">skip to main content</a></div>
    <div id="wrapper">
      <nav class="clearfix">
        <ul class="clearfix">
          <li><a href="#">Magic Finder</a></li>
          <li><a href="#">Events</a></li>
          <li><a href="#">Post</a></li>
          <li><a href="#">Map</a></li>
          <li><a href="#">Register</a></li>
          <li><a href="#">Sign In</a></li>
        </ul>
        <a href="#" id="pull">Menu</a> </nav>   
     
      <!--search bar-->
      <form class="form-wrapper cf">
            <input type="text" placeholder="Enter Address or zip code..." required>
            <button type="submit">Search</button>
        </form>
     
      <div id="googleMap"></div>
       
      <div id="maincontentcontainer">
        <div id="maincontent">
       
    </div>
    </div>
     
    <!-- More Scripts-->
    <script src="js/responsivegridsystem.js"></script>
        <script>
            $(function() {
                var pull        = $('#pull');
                    menu        = $('nav ul');
                    menuHeight    = menu.height();
     
                $(pull).on('click', function(e) {
                    e.preventDefault();
                    menu.slideToggle();
                });
     
                $(window).resize(function(){
                    var w = $(window).width();
                    if(w > 320 && menu.is(':hidden')) {
                        menu.removeAttr('style');
                    }
                });
            });
        </script>
    </body>
    </html>

  7. #6
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    You're not calling the initialize() function. You're defining it, but not calling it.

    Anywhere after the </div> tag for googleMap will do.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  8. #7
    Junior Member
    Join Date
    May 2013
    Posts
    6
    Member #
    36231
    ok so like i said i am rather new at this, how do i call for the function?

  9. #8
    Junior Member
    Join Date
    May 2013
    Posts
    6
    Member #
    36231
    what i don't understand is if i do this ...

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <script
    src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCXB10peXuvlVOaYum_29bdmSmSFqIgHto&sensor=false">
    </script>
     
    <script>
    function initialize()
    {
    var mapProp = {
      center:new google.maps.LatLng(51.508742,-0.120850),
      zoom:5,
      mapTypeId:google.maps.MapTypeId.ROADMAP
      };
    var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
    }
     
    google.maps.event.addDomListener(window, 'load', initialize);
    </script>
    <style type="text/css">
    html {height:100%}
    body {height:100%;margin:0;padding:0}
    #googleMap {height:100%}
    </style>
    </head>
     
    <body>
    <div id="googleMap"></div>
     
    </body>
    </html>
    I get google maps working fine, but the moment i try to get it to run under my nav, it won't run ... even without calling for it.

  10. #9
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Take that last line out of your script. All you need to do is this:
    Code:
    <div id="googleMap"></div>
    <script type="text/javascript">initialize();</script>
    The second line calls your initialize function.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  11. #10
    Junior Member
    Join Date
    May 2013
    Posts
    6
    Member #
    36231
    Thank you


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:07 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com