Copied to clipboard

Flag this post as spam?

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


  • wildlife 54 posts 74 karma points
    Jun 18, 2010 @ 13:04
    wildlife
    0

    Unable to save addresses or get map to display on page.

    Hello,

    I've installed your Google Maps datatype package, following all found instructions to the best of my ability (I'm still a newbie that's just gradually getting better at all this, so bear with me), and am having some problems with getting it to work.  I don't know if I've done everything correctly or not.  Any help you can provide would be greatly appreciated.

    I have set up a Document Type called "Test Google Map".  I added a field called Google Map and an alias of "googleMap" using your Google Map datatype.

    I have set up a "Test Google Map" template coded as follows:

    <%@ Master Language="C#" MasterPageFile="/umbraco/masterpages/default.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="head" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="Description" content='<umbraco:Item field="metaDescription" recursive="true" runat="server"></umbraco:Item>' />
    <title><asp:placeholder runat="server"><umbraco:Item runat="server" field="pageName" /> - Florida Youth Conservation Centers Network</asp:placeholder></title>
    <script type="text/javascript" src="/scripts/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
    <script type="text/javascript">
    var fm = {};
    fm.maps = new Array();
    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>
    </head>
    <body>

    <div id="map1" class="map">
    <umbraco:Item field="googleMap" runat="server"></umbraco:Item>
    </div>
    </body>
    </html>


    </asp:Content>

    I have set up a Content page called "Test Google Map".  In there, the package works at a level of allowing me to enter an address and a proper map for that address does show up in the preview in the admin area.

    However, when I try to save and publish the address I added, the change does not stay and the map reverts back to the Palo Alto default map.  When I try to go to the test-google-map.aspx page in my browser, no map appears on the page.

    Can you help me get this to work?

     

     

     

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Jun 18, 2010 @ 17:44
    Darren Ferguson
    0

    Can you provide:

    Version of Umbraco, OS, Database?

    Screenshot of mapdatatype in the backend.

    Which browser are you using?

    Do you get any javascript errors - have you tried debugging with firebug?

    I'll need *a lot* more information to able to assist - Access to your Umbraco installation would be the best way to resolve.

  • wildlife 54 posts 74 karma points
    Jun 19, 2010 @ 10:33
    wildlife
    0

    Version of Umbraco - v 4.0.3

    OS - Windows 2008 Server with IIS7

    Database - MS SQL Server 2008

    Screenshot of mapdatatype in the backend - Is this what you mean?

    <img src="http://www.fyccn.org/screencap-googlemap-datatype.jpg">

    Or do I need to get a screencap elsewhere?

    Which browser are you using - Firefox, but the problem is the same in IE

    Do you get any javascript errors - have you tried debugging with firebug?

    Nothing showing up when I add an address and have the problem when I save it.  But when I try to access my test page, I get the following error in Firefox's error console:

    Error: missing } in compound statement
    Source File: http://www.fyccn.org/test-google-map.aspx
    Line: 38, Column: 4
    Source Code:
     });

    I'll need *a lot* more information to able to assist.  --- Understood.  I'll try to get whatever else is needed.

    Access to your Umbraco installation would be the best way to resolve.  ---  I'll ask those I'm doing this testing/developing for if this would be doable.

    Getting this mapping package and Tim's Locator package working properly is very important for the work I'm doing, so thanks again for any help you can provide. 

    Did I set up the three scripts in the template correctly?  I wasn't clear on exactly what was needed there, particularly the Google Maps API one.  I'm wondering if no map is displaying because the address I input is not getting saved when I try to save and publish.  I was thinking it would at least put up a map of the default Palo Alto location though.

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Jun 21, 2010 @ 16:33
    Darren Ferguson
    0

    Erm:

     

    Error: missing } in compound statement
    Source File: http://www.fyccn.org/test-google-map.aspx
    Line: 38, Column: 4
    Source Code:
     });

    Is quite self explanatory no?

    you are missing a closing }

    before your closing script tag.

     

  • wildlife 54 posts 74 karma points
    Jul 01, 2010 @ 21:56
    wildlife
    0

    I copied and pasted this from the page where this script was found.

    Is the problem with the line above </script>

            });
    </script>

     

    Does that need an additional } ?

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft