Skip to content

Instantly share code, notes, and snippets.

@zhuzhe1983
Last active April 28, 2016 01:31
Show Gist options
  • Save zhuzhe1983/6a80a7c1c4ede1a8ec0da85756b4a9d9 to your computer and use it in GitHub Desktop.
Save zhuzhe1983/6a80a7c1c4ede1a8ec0da85756b4a9d9 to your computer and use it in GitHub Desktop.
$('img').each(function(i,o){
var src = $(o).attr('src');
var arr_src = src.split('/');
var z = arr_src[9];
var y = arr_src[10];
var x = arr_src[11];
if( x && y && z ){
src = "http://webrd03.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x="+x+"&y="+y+"&z="+z;
src = "https://b.tile.thunderforest.com/transport/"+z+"/"+x+"/"+y+".png"
src = "http://a.tile.openstreetmap.org/"+z+"/"+x+"/"+y+".png"
$(o).attr('src',src);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment