Copied to clipboard

Flag this post as spam?

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


  • hetaurhet 245 posts 267 karma points
    Jul 30, 2011 @ 06:48
    hetaurhet
    0

    Google map suddenly not working

    I have created one doc type say map having single property of the type googlemap and has its template.

    in template I have following code,

    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
     <html>
      <head>
        <style type="text/css">
        .gMap1
        {
          width:500px;
          height:450px;
          display:block;
          align:center;
        }
      </style>  

      <!-- Google map scripts starts -->
      
    <script type="text/javascript">
        
    $.fn.googleMap = function(location,options) {
        var defaults = {
            lat: -33.302959,
            long: 151.419733,
            zoom: 15,
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            mapTypeControl: false,
            controls: ['GSmallZoomControl3D']
        };
     
        options = $.extend(defaults, options || {});
     
        if (location) {
            value = $.trim(location);
            var point = location.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>
      
      </head>
    <body>  
     

    <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>   
    <script type="text/javascript">
            
              $(document).ready(function (){
                $("#map_container").googleMap("<umbraco:Item field="mapForContacts" runat="server"></umbraco:Item>");
              });

    </script>  
      

      <div id="map_container" class="gMap1"></div>


    </body>
    </html>
    </asp:content>

     

    create content page from this... but it gives following error

    $ is not defined
    http://u1test.dadabhagwan.org.peppermint.arvixe.com/1616.aspx
    Line 18

    $ is not defined
    http://u1test.dadabhagwan.org.peppermint.arvixe.com/1616.aspx
    Line 56

    ...... so what is the issue? previously it was working fine...

     

  • Sherry Ann Hernandez 320 posts 344 karma points
    Jul 30, 2011 @ 08:43
    Sherry Ann Hernandez
    0

    You need to include the jquery file in your page.

  • hetaurhet 245 posts 267 karma points
    Jul 30, 2011 @ 10:02
    hetaurhet
    0

    but which jquery file? how can i know that?

  • hetaurhet 245 posts 267 karma points
    Aug 02, 2011 @ 10:18
    hetaurhet
    0

    ok.. map is showing now... but I want to show this map in lightbox and I tried some but not those are not working.

Please Sign in or register to post replies

Write your reply to:

Draft