Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Phong Vu 2 posts 22 karma points
    Sep 17, 2011 @ 07:09
    Phong Vu
    0

    Google map is not rendered after deploy on server

    Hi,

    First of all, thanks Darren for the very nice works.

    I'm working with a page using Darren's google map data type on it.

    I've managed to make it work nicely on my local machine (and few other local machine as well), but as fast as I deploy the web on server, the map just stop rendering. The script just simple does not work at all for the deployed page on server.

    I've banged my head to the wall for the few days without luck, so, I end up here asking for helps.

    I would appreciate any suggestion.

    btw, I'm using arvixe as my host.

    Here's my script to render the map

    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
        <script type="text/javascript">
            $.fn.googleMap = function (location, options) {
                var defaults = {
                    lat: 53.41,
                    long: -2.99,
                    zoom: 13,
                    mapTypeId: google.maps.MapTypeId.ROADMAP,
                    mapTypeControl: false,
                    controls: ['GSmallZoomControl3D']
                };
    
                options = $.extend(defaults, options || {});
    
                if (location) {
                    var value = $.trim(location);
                    var point = value.split(',');
                    options.lat = parseFloat(point[0]);
                    options.long = parseFloat(point[1]);
                    options.zoom = parseFloat(point[2]);
                };
    
                var center = new google.maps.LatLng(options.lat, options.long);
    
                var map = new google.maps.Map(this.get(0), $.extend(options, { center: center }));
    
                var storeMarker = new google.maps.Marker({
                    position: center,
                    map: map
                });
            };
        </script>

    And after that is getting latitude and longitude from google map data type (I added the style to show google Map correctly in css file):

    <div id="googleMap" class="contactMap"></div>
    
        <script type="text/javascript">
            $(document).ready(function () {
                $("#googleMap").googleMap("<umbraco:Item field='gmap' runat='server'/>");
            });
        </script>

    Regards,

    Phong Vu

  • Phong Vu 2 posts 22 karma points
    Sep 18, 2011 @ 08:54
    Phong Vu
    0

    I found the problem in my configuration, thanks anyway ^_^

    btw, How to set the topic as resolved?

  • Matt Marceau 5 posts 25 karma points
    Apr 04, 2013 @ 15:50
    Matt Marceau
    0

    What was your solution?  Please post it here so others may benefit from it.

Please Sign in or register to post replies

Write your reply to:

Draft