Skip to content

Instantly share code, notes, and snippets.

@deanputney
Created April 22, 2013 17:25
Show Gist options
  • Save deanputney/5436913 to your computer and use it in GitHub Desktop.
Save deanputney/5436913 to your computer and use it in GitHub Desktop.
Diff for OpenLayers.js in Ushahidi for the panopticon-ushahidi theme: https://github.com/mustardhamsters/panopticon-ushahidi
81c81
< b=OpenLayers.Lang.defaultCode);OpenLayers.Lang.code=b},translate:function(a,b){var c=OpenLayers.Lang[OpenLayers.Lang.getCode()];(c=c&&c[a])||(c=a);b&&(c=OpenLayers.String.format(c,b));return c}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Util=OpenLayers.Util||{};OpenLayers.Util.getElement=function(){for(var a=[],b=0,c=arguments.length;b<c;b++){var d=arguments[b];"string"==typeof d&&(d=document.getElementById(d));if(1==arguments.length)return d;a.push(d)}return a};OpenLayers.Util.isElement=function(a){return!!(a&&1===a.nodeType)};OpenLayers.Util.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)};OpenLayers.Util.removeItem=function(a,b){for(var c=a.length-1;0<=c;c--)a[c]==b&&a.splice(c,1);return a};
---
> b=OpenLayers.Lang.defaultCode);OpenLayers.Lang.code=b},translate:function(a,b){var c=OpenLayers.Lang[OpenLayers.Lang.getCode()];(c=c&&c[a])||(c=a);b&&(c=OpenLayers.String.format(c,b));return c}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Util=OpenLayers.Util||{};OpenLayers.Util.getElement=function(){for(var a=[],b=0,c=arguments.length;b<c;b++){var d=arguments[b];"string"==typeof d&&(d=window.top.document.getElementById(d)||document.getElementById(d));if(1==arguments.length)return d;a.push(d)}return a};OpenLayers.Util.isElement=function(a){return!!(a&&1===a.nodeType)};OpenLayers.Util.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)};OpenLayers.Util.removeItem=function(a,b){for(var c=a.length-1;0<=c;c--)a[c]==b&&a.splice(c,1);return a};
@deanputney
Copy link
Author

Relevant change is to make OpenLayers accept a DOM element from the parent window as well as from the current document so that OpenLayers can influence maps outside the current frame.

"string"==typeof d&&(d=document.getElementById(d));
"string"==typeof d&&(d=window.top.document.getElementById(d)||document.getElementById(d));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment