Force Google maps v2 api to refresh custom icon image
I am using the Google static maps API V2 to create a map with a custom blue marker icon:
Unfortunately, I tested the url before the my custom image was online and Google seems to have cached that knowledge somehow:
http://maps.googleapis.com/maps/api/staticmap?center=51.86654,-2.2480254&zoom=6&size=100x70&sensor=false&markers=icon:http%3A%2F%2Fwww.stolencamerafinder.com%2Fimages%2Fpin-lost.png%7C51.86654,-2.2480254 (if this image has a blue icon, then it the cache has been updated since I posted this question!)
<img src="http://maps.googleapis.com/maps/api/staticmap?center=51.86654,-2.2480254&zoom=6&size=100x70&sensor=false&markers=icon:http%3A%2F%2Fwww.stolencamerafinder.com%2Fimages%2Fpin-lost.png%7C51.86654,-2.2480254">
I can trick it into fetching it by adding a nonsense parameter to my icon url (eg: "?开发者_如何学Goa=a") :
http://maps.googleapis.com/maps/api/staticmap?center=51.86654,-2.2480254&zoom=6&size=100x70&sensor=false&markers=icon:http%3A%2F%2Fwww.stolencamerafinder.com%2Fimages%2Fpin-lost.png?a=a%7C51.86654,-2.2480254
<img src="http://maps.googleapis.com/maps/api/staticmap?center=51.86654,-2.2480254&zoom=6&size=100x70&sensor=false&markers=icon:http%3A%2F%2Fwww.stolencamerafinder.com%2Fimages%2Fpin-lost.png?a=a%7C51.86654,-2.2480254">
However I don't want to re-deploy my app just for this. My question is:
- Is there some way to request that Google refresh their cache?
- Does anyone know how long it may take to get updated (if at all)?
As duncan noticed first, the image looks ok now.
So, for anyone else that has this problem, it took less than a day for my image to get refreshed. Of course, YMMV.
精彩评论