Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    Sep 24, 2013 @ 09:26
    Anthony Candaele
    0

    jquery-1.10.1.min.map not found

    Hi,

    I'm using Google Maps Datatype 2.1.0 in Umbraco 6.1.5.

    my version of jQuery is 1.10.1 . However, when I check the Network traffic in Chrom Dev, I'm getting a 404 error for:

    jquery-1.10.1.min.map

     

    Should I use an older version of jQuery?

    Thanks for the advice,

    Anthony

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Sep 24, 2013 @ 09:37
    Lee Kelleher
    1

    Hi Anthony,

    It's not Google Maps causing this, but a combination of a few other things.

    The jQuery script that you are using has a reference to a source-map file ... and Chrome has an option enabled to use that source-map (once you are in the dev tools) - and if that source-map isn't there - then boom 404!

    Options are:

    • Edit the jQuery script to remove the reference
    • Add the source-map file on your server
    • Disable Chrome's setting for using source-maps

    See this Stack Overflow page for more details: http://stackoverflow.com/questions/18365315/jquerys-jquery-1-10-2-min-map-is-triggering-a-404-not-found

    I believe that Chrome only attempts to download source-maps once you go into the dev-tools, so regular visitors of your website wont experience this.

    Cheers,
    - Lee

  • Anthony Candaele 1197 posts 2049 karma points
    Sep 24, 2013 @ 10:06
    Anthony Candaele
    100

    Hi Lee,

    Thanks for your reply. I switched the jQuery version, now I'm using jQuery 1.7.2 and the error message for the missing map referrence is gone.

    However I'm not seeing any map. I'm just seeing the Google Map Data Type coördinates:

    51.916208,4.523255000000063,13

    My script looks like this:

    <script type="text/javascript">// <![CDATA[
    </p>
    
    <p>   $(document).ready(function () {  </p>
    
    <p>   $('section[class=map]').each(function() {</p>
    
    <p> </p>
    
    <p> </p>
    
    <p> </p>
    
    <p>$(this).addClass('mapdimensions');</p>
    
    <p>var mapId = $(this).attr('id');</p>
    
    <p> </p>
    
    <p>var value = $(this).html();</p>
    
    <p>value = $.trim(value);</p>
    
    <p> </p>
    
    <p>var point = value.split(',');</p>
    
    <p> </p>
    
    <p>var lat = parseFloat(point[0]);</p>
    
    <p>var lon = parseFloat(point[1]);</p>
    
    <p>var zoom = parseFloat(point[2]);</p>
    
    <p> </p>
    
    <p>var p = new google.maps.LatLng(lat, lon);</p>
    
    <p> </p>
    
    <p>var myOptions = {</p>
    
    <p>center: p,</p>
    
    <p>zoom: zoom,</p>
    
    <p>mapTypeId: google.maps.MapTypeId.ROADMAP</p>
    
    <p>};</p>
    
    <p> </p>
    
    <p>fm = new google.maps.Map(document.getElementById(mapId),</p>
    
    <p>myOptions); </p>
    
    <p> </p>
    
    <p>var marker = new google.maps.Marker({</p>
    
    <p>position: p,</p>
    
    <p>title:"We are here!",</p>
    
    <p>animation: google.maps.Animation.DROP</p>
    
    <p>});</p>
    
    <p> </p>
    
    <p> </p>
    
    <p>// To add the marker to the map, call setMap();</p>
    
    <p>marker.setMap(fm);</p>
    
    <p> </p>
    
    <p>});</p>
    
    <p> });</p>
    
    <p>  
    // ]]></script>

    <script type="text/javascript">

       $(document).ready(function () {  

       $('section[class=map]').each(function() {

     

     

     

    $(this).addClass('mapdimensions');

    var mapId = $(this).attr('id');

     

    var value = $(this).html();

    value = $.trim(value);

     

    var point = value.split(',');

     

    var lat = parseFloat(point[0]);

    var lon = parseFloat(point[1]);

    var zoom = parseFloat(point[2]);

     

    var p = new google.maps.LatLng(lat, lon);

     

    var myOptions = {

    center: p,

    zoom: zoom,

    mapTypeId: google.maps.MapTypeId.ROADMAP

    };

     

    fm = new google.maps.Map(document.getElementById(mapId),

    myOptions); 

     

    var marker = new google.maps.Marker({

    position: p,

    title:"We are here!",

    animation: google.maps.Animation.DROP

    });

     

     

    // To add the marker to the map, call setMap();

    marker.setMap(fm);

     

    });

     });

      </script>

     

    This script has always worked in previous projects.

    My html element on the page looks like this:

    <section id="map" class="row-fluid map">

                          @if (Model.Content.HasValue("activityGoogleMap"))

                            {

                                <h2>Map</h2>

                                @Model.Content.GetPropertyValue("activityGoogleMap")

                            }

                            

                        </section>

     

    ps: sorry, I erroneously clicked the 'Solved' link. Wish I could undo this.

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Sep 24, 2013 @ 10:20
    Lee Kelleher
    1

    Sounds like there's another JS error somewhere? (The value from the data-type itself appears fine)

  • Anthony Candaele 1197 posts 2049 karma points
    Sep 24, 2013 @ 10:42
    Anthony Candaele
    0

    yeah, it must be this part:

    $('section[class=map]')

    for some reason, when I try this in the Chrom Console, I'm getting an empty array back

  • Anthony Candaele 1197 posts 2049 karma points
    Sep 24, 2013 @ 11:17
    Anthony Candaele
    0

    I use jQuery v 1.10.2 now and downloaded the Map file for jQuery 1.10.2

    when I debug the page, I'm seeing this error:

    1. Uncaught ReferenceError: google is not defined het-etmaal-van-de-communicatiewetenschap-2013.aspx:126
      1. x.extend.readyjquery-1.10.2.js:433
      2. q

    So for some reason, this method in my script has stopped working:

    var p = new google.maps.LatLng(lat, lon);

  • Anthony Candaele 1197 posts 2049 karma points
    Sep 24, 2013 @ 13:42
    Anthony Candaele
    0

    Ok, I'm already this far that an empty Google Map appears on the screen:

     

    anyone experienced the same problem? And how did you solve it, thanks for your help,

    Anthony

Please Sign in or register to post replies

Write your reply to:

Draft