Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

hacky way to decode escaped url components

  • Loading branch information...
commit 0a6e09062574b64bf0b51fc2ff64477756c1cc7f 1 parent efb0543
@spadgos authored
Showing with 13 additions and 6 deletions.
  1. +13 −6 app/app.js
View
19 app/app.js
@@ -305,11 +305,10 @@ $(function(){
var zoom = 15;
if (window.location.hash.length > 1) {
var hash = window.location.hash.substr(1),
- info, i;
- try {
- // {"_":[52.371124458365045,4.888959665298436],"amenity=parking":{"o":2,"a":2.6,"r":0.8,"g":0.7,"c":"red"}}
- info = JSON.parse(hash);
- for (i in info) {
+ decode;
+ decode = function (h) {
+ var info = JSON.parse(h);
+ for (var i in info) {
if (i === '_') {
center = new google.maps.LatLng(info._[0], info._[1]);
zoom = info._[2];
@@ -323,7 +322,15 @@ $(function(){
setTimeout(addFeature.bind(null, i), 250);
}
}
- } catch (e) {}
+ };
+ try {
+ // {"_":[52.371124458365045,4.888959665298436],"amenity=parking":{"o":2,"a":2.6,"r":0.8,"g":0.7,"c":"red"}}
+ decode(hash);
+ } catch (e) {
+ try {
+ decode(unescape(hash))
+ } catch (ee) {}
+ }
}
map = new google.maps.Map(mapElement, {
center: center,
Please sign in to comment.
Something went wrong with that request. Please try again.