Copied to clipboard

Flag this post as spam?

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


  • J 447 posts 864 karma points
    Mar 17, 2016 @ 09:51
    J
    0

    Map not displaying

    I have installed this component in Umbraco 6.

    Selected a location in the backend and now trying to display it on the front end of the site. The below code doesnt work:

    <asp:Content ContentPlaceHolderID="Header" runat="server">
    
    </asp:Content>
    
    <asp:Content ContentPlaceHolderID="Main" runat="server">
       <div id="map1" class="map" style="height:500px; width:500px;">
       <umbraco:Item field="place1" runat="server"></umbraco:Item> 
    </div>
    
    
    <script> 
    if (typeof ItemEditing == 'undefined') {
    $('div[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]);
    fm.maps[fm.maps.length] = new GMap2(document.getElementById(mapId));
    var m = fm.maps[fm.maps.length-1];
    var p = new GLatLng(lat, lon);
    m.setCenter(p, zoom); 
    
    var marker = new GMarker(p);
    m.addOverlay(marker); 
    });
          }
    </script>
    
    
    
    
    
    <script src="https://maps.googleapis.com/maps/api/js?key=qwertyuioplhfds"></script>
    
    
    
    
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    
    
    </asp:Content>
    

    Could anyone advise why?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 17, 2016 @ 19:18
    Jan Skovgaard
    0

    Hi J

    Do you get any error messages in your browsers console log?

    /Jan

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies