abenzer/represent-map

Map display and Startups label have disappeared

Closed this issue · 8 comments

I added data to the MySQL database using phpMyAdmin and changed the structure of the places table to allow for certain NULL values.
Now, the Startups label no longer appears in the right sidebar and the map doesn't get displayed.
Please see here: www.geneva-startups.ch
Is there a limited number of startups one can add? (I added 1'315 startups)

It appears that the problem had to do with encoding. I changed lines 185 to 188 of index.php as follows:

          $place[title] = utf8_encode(htmlspecialchars_decode(addslashes(htmlspecialchars($place[title]))),ENT_COMPAT,'UTF-8', false);
          $place[description] = utf8_encode(str_replace(array("\n", "\t", "\r"), "", htmlspecialchars_decode(addslashes(htmlspecialchars($place[description])))),ENT_COMPAT,'UTF-8', false);
          $place[uri] = utf8_encode(addslashes(htmlspecialchars($place[uri])),ENT_COMPAT,'UTF-8', false);
          $place[address] = utf8_encode(htmlspecialchars_decode(addslashes(htmlspecialchars($place[address]))),ENT_COMPAT,'UTF-8', false);

This solved the problem.

Cool, thanks for the update. Glad you worked it out.

Actually, the problem is half solved! I've got the markers and the map displayed now, but the labels and infowindows are empty!

Do you see any JS errors in your console when loading the page?

Nope! I just see the following:
Google Maps API warning: SensorNotRequired: https://developers.google.com/maps/documentation/javascript/error-messages
which refers to util.js line 32.
I think the problem still has to do with the encoding somehow!
Or rather, the data isn't being pushed to the markers for some reason!

Alex, Would you please tell me what you are trying to do with this code:
htmlspecialchars_decode(addslashes(htmlspecialchars($place[title])))
It doesn't appear to be working for French and German. I'm really struggling to find an alternative with a wider scope in terms of compatible languages.

I tried changing the charset to ISO-8859-1. The web page source looks fine, but it just won't render on the map.

Finally working! Good God, that was a tough one to crack! Here's the code that I changed:
$place[title] = htmlentities($place[title],ENT_QUOTES,"ISO-8859-1");
$place[description] = htmlentities(str_replace(array("\n", "\t", "\r"), "", $place[description]),ENT_QUOTES,"ISO-8859-1");
$place[uri] = htmlentities($place[uri],ENT_QUOTES,"ISO-8859-1");
$place[address] = htmlentities(str_replace(array("\n", "\t", "\r"), "", $place[address]),ENT_QUOTES,"ISO-8859-1");