Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help setting up script. #35

Closed
sda3fda opened this issue Mar 1, 2014 · 4 comments
Closed

Help setting up script. #35

sda3fda opened this issue Mar 1, 2014 · 4 comments

Comments

@sda3fda
Copy link

sda3fda commented Mar 1, 2014

Dear Daniele,

I am new to JQuery and sorts, so I have some trouble using your script. You could hint at what is wrong with my code?

I downloaded the latest version from your homepage and integrated it like that:

<!DOCTYPE html>
<html lang="en">
    <head>
        <script type="text/javascript" src="js/jquery-1.10.2.min.js" ></script>
        <script type="text/javascript" src="js/maplace.js"></script>
        <script src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry&v=3.7">/script> 
<script>
    $(function() {
    var maplace = new Maplace(); 
    maplace.Load(); 
    });
</script>
</head>
<body>
<div id="gmap"></div>
</body>
</html>

maplace.js and the jquery paths are correct.
Unfortunately, I cannot see anything.

Do you happen to know what happened, or what was wrong?

Thanks a lot in advance!

@tehnn
Copy link

tehnn commented Mar 2, 2014

$(function() {
var maplace = new Maplace({ map_div: '#gmap' });
maplace.Load();
});

@sda3fda
Copy link
Author

sda3fda commented Mar 2, 2014

Thank you very much!
But I thought gmap was the default map_div anyway?

Unfortunately, even after changing what you have suggested, the page does not work :( . Is there any other simple working example html file that I can take for reference?

@tehnn
Copy link

tehnn commented Mar 2, 2014

The following codes are work for me.

    <style>
        .gmap {
            height:600px;
            width: 90%;
            padding: 3px;
            border: 5px solid #ddd;
            font-size: 90%;
        }
    </style>

    <script src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry&v=3.7"></script>
    <script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
    <script src="mapplace.min.js"></script>
    <script>
        $(function() {
            new Maplace({
                map_div: '#gmap',
            }).Load();
        });

    </script>

</head>
<body>
    <div align="center">
        <div id="gmap" class="gmap"></div>
    </div>      
</body>

@sda3fda
Copy link
Author

sda3fda commented Mar 2, 2014

Thank you for your suggestion. I found out that the download of the js files (both min and non-min) were corrupt. When I included directly from the homepage, I got it to work. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants