Tutorial uses snapshotImage rather than getImageSnapshot
get-map Tutorial command uses CmdUtils.snapshotImage, but as of ticket #101, this function has been renamed to CmdUtils.getImageSnapshot.
2
people have this problem
I have this problem, too!
Tell me when someone solves it.
The more people who report this problem, the more it gets noticed.
The more people who report this problem, the more it gets noticed.
-
Inappropriate?Tutorial is on
The_Ubiquity_0.1_Command_Tutorial
and here the changed and working function.
Just enter it into your ubiquity command editor
chrome://ubiquity/content/editor.html
CmdUtils.CreateCommand({
name: "map-me",
_getMapUrl: function() {
var loc = CmdUtils.getGeoLocation();
var mapUrl = "http://maps.google.com/staticmap?";
var params = {
center: loc.lat + "," + loc.long,
size: "500x400",
zoom: 14,
key: "ABQIAAAAGZ11mh1LzgQ8-8LRW3wEShQeSuJunOpTb3RsLsk00-MAdzxmXhQoiCd940lo0KlfQM5PeNYEPLW-3w"
};
return mapUrl + jQuery.param( params );
},
preview: function( pblock ) {
var msg = "Inserts a map of your current location:
";
msg += "".replace( /%s/, this._getMapUrl() );
pblock.innerHTML = msg;
},
execute: function( ) {
CmdUtils.getImageSnapshot( this._getMapUrl(), function(imgData) {
CmdUtils.setSelection( "");
})
}
})
I’m thankful
1 person says
this solves the problem
-
Inappropriate?Thank you. I suppose I should have posted the fix along with the report.
Loading Profile...




