Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Issues with user location map

Issues with user location map

Peter Leleulya
Reply

Hi guys,

On a DW 9.4.13 solutions we seem to encounter issues with the maps section of the user edit page in the CMS.
This functionlitiy used to work fine before ...

When using the GET LOCATION FROM API button on the user edit page in the CMS an unable to get location error is always thrown, like: Unable to get location for address "Brouwerijstraat  7523XC Enschede  Nederland" (see how it somehow doesn't use the house number which is provided)
In the browser console an XML Parsing Error shows: XML Parsing Error:

not well-formed Location: ~myproject~/Admin/Public/Module/Maps/ShowOnMap.aspx?action=get&address=Brouwerijstraat%20%207523XC%20Enschede%20%20Nederland
Line Number 1, Column 1:
{
^

When using the button SHOW LOCATION ON MAP on the user edit page in the CMS a Google Maps JavaScript API error:

MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error is thrown in the browser console while the api key is added in the CMS and the map in the front-end with the same domain and scheme settings doés show the map.

 


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Peter,

I have reproduced both issues and registered these two bugs...

Bug 51534: Get location from API results in XML parsing error
The problem is that the response from Dynamicweb contains a wrong content-type header which cannot be interpreted by the browser, so it defaults to handling it as XML. It seems to work in Chrome though.
Workaround: Use Chrome browser

Bug 51516: Show location on map results in missing key error
For some reason we have been using two separate settings for the API key. You can set the correct one by going to Settings > Control Panel > Maps.
The wrong one you have to add manually to /Files/GlobalSettings.aspx
Workaround: Add the API key value to global settings: /Globalsettings/Settings/GoogleAPIKeys/Maps

Thanks for reporting these issues. We will fix them as soon as possible.

Best regards,
Morten

 
Peter Leleulya
Reply

Thanks for the feedback Morten

 
Peter Leleulya
Reply

Eehrm,

What should the Global setting look like?
The one I set via Controlpanel and is showing in the front end (but not in the back end) is mentioned in the global settings like:

   <Settings>
....
     <GoogleMaps>
      <GoogleMapsAPIKey>AIzaSyCfYgzOn52GAfXF_ytNBS41U2oT5T6Kn6k</GoogleMapsAPIKey>
      <GoogleMapsClientID></GoogleMapsClientID>
    </GoogleMaps>
....
 </Settings>

How should the extra nodes be formatted?
I can't find a sample in older solutions ...

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

The API key should be added twice until we fix this:

/Globalsettings/Settings/GoogleAPIKeys/Maps (only used for "show on map")
/Globalsettings/Settings/GoogleMaps/GoogleMapsAPIKey (used everywhere else)

So your global settings should look something like this...

<?xml version="1.0" ?>
<Globalsettings>
  <Settings>
    ...
    <GoogleMaps>
      <GoogleMapsAPIKey>yourKey</GoogleMapsAPIKey>
      <GoogleMapsClientID></GoogleMapsClientID>
    </GoogleMaps>
    <GoogleAPIKeys>
      <Maps>yourKey</Maps>
    </GoogleAPIKeys>
    ...
  </Settings>
  ...
</Globalsettings>
 
Peter Leleulya
Reply

Yes, adding the nodes worked to get a map shown in the CMS.
Using the API in Google Chrome still doesn't work, no address can be found, for example our company address, see img.

So we'll wait for the bugfix to release
Thanks in advance.

InnovadisAddress.PNG
 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Peter

The #51534 and #51516 has both been fixed in version 9.4.15

To upgrade please choose this version from here:

http://doc.dynamicweb.com/releases-and-downloads/releases

Let me know if you need any more help regarding this

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum