Error after editing Google Maps plugin for TinyMCE Solved

User's avatar
Marianne B.
11:11 Mar 26, 2015
Hi,

First of all I have to say I love the plugin so far (bought it yesterday) except for this quite big problem.

If I add a map to my WYSIWYG (TinyMCE) it works like a charm and I can save the page and edit my texts how many times I want without a problem.
But if I open the dialog to edit the map, with or without making any changes to it, press OK and try to save my page I get an error the next time it tries to load my WYSIWYG.

The error according to my console is:
"SyntaxError: JSON.parse: unexpected character at line 1 column 105 of the JSON data"

The error is in plugin.min.js (line 1, col 1760) which is this part:
"JSON.parse(unescape(node.attr("data-options")))" 

If I use console.log(unescape(node.attr("data-options"))) I get the value:
"{"lat":35,"lng":-93,"zoom":3,"type":"roadmap","width":400,"height":320,"settings":{"weather_in_celsius":undefined,"traffic_layer":undefined,"weather_layer":undefined,"mapTypeControl":true,"zoomControl":true,"rotateControl":false,"scaleControl":true,"streetViewControl":false,"panControl":false,"overviewMapControl":false,"draggable":true,"disableDoubleClickZoom":false},"objects":{"Marker":[],"Circle":[],"Polyline":[],"Text":[],"Polygon":[],"Rectangle":[],"TrafficLayer":[],"WeatherLayer":[]}}"

The error seems to be that weather_in_celcius (and traffic_layer and weather_layer) is undifined instead of true/false.

When I have first inserted the map and saved everything I get a boolean so it's only when I open the dialog to edit it seems to loose those settings the next time I load my WYSIWYG.

There is also some minor things; like the textbox connected to a marker is placed in the wrong place when I visit my site. It looks great in the WYSIWYG though.

This seems to happen to me in both Firefox (36.0.4) and Chrome (41) on Windows 7.

Brgds
Support team avatar
JS+
07:51 Mar 28, 2015
Hello!

Thank you for such detailed bug report. We checked this and fixed the problem with JSON parsing, Please try to update and check again.