Google Maps onebox issues

I have a fix here:

https://github.com/discourse/onebox/pull/293

This is a “best effort” solution.

  1. Previews must be static images or else each update of the composer preview pane would cause a reload of the embedded iframe. Google would probably consider this abuse, and browser performance would plummet straight to hell.

  2. I can only display static maps using data found in any of the available URLs that directly maps to data the static map API will accept. This is not the case for the cid field that contains the ID of the custom map, let alone the protobuf-encoded data field in the source URL. Thus, markers placed on custom maps will not appear on any previews.

  3. For a reason I have not (yet) figured out, Google’s webserver does sometimes, but not always, redirect @RaceProUK’s source URLs to the “canonical” Google maps URL. This seems to be totally random and may or may not be a transient problem. The engine now tries up to 10 times to get the canonical URL; if this fails, it constructs a fallback more or less blindly, based on assumptions and circumstancial evidence regarding the encoding of the data parameter.

6 curtidas