• 制作街道静态图像,如:
如果你访问,你就会看到一种形象,即“神,我们对此没有图像”。
是否有办法发现这一“音响”状态,以便我能够回到另一个形象?
• 制作街道静态图像,如:
如果你访问,你就会看到一种形象,即“神,我们对此没有图像”。
是否有办法发现这一“音响”状态,以便我能够回到另一个形象?
this situation is already build in in the 3.0 version due the boolean test status === streetviewStatus.Ok, here is a snippet from my situation solving
if (status === google.maps.StreetViewStatus.OK) {
var img = document.createElement("IMG");
img.src = http://maps.googleapis.com/maps/api/streetview?size=160x205&location= + lat + , + lng + &sensor=false&key=AIzaSyC_OXsfB8-03ZXcslwOiN9EXSLZgwRy94s ;
var oldImg = document.getElementById( streetViewImage );
document.getElementById( streetViewContainerShow ).replaceChild(img, streetViewImage);
} else {
var img = document.createElement("IMG");
img.src = ../../images/ProfilnoProfilPicture.jpg ;
img.height = 205;
img.width = 160;
var oldImg = document.getElementById( streetViewImage );
document.getElementById( streetViewContainerShow ).replaceChild(img, streetViewImage);
}
One quick solution would be to load the image file using xmlrpc and check that its md5sum is 30234b543d5438e0a0614bf07f1ebd25
, or that its size is 1717
bytes (it s unlikely that another image can have exactly the same size), but that s not very robust since I have seen Google change the position of the text in the image. Though it s a very good start for a prototype.
You could go for image processing instead. Note that it s still not perfectly robust since Google could decide to change the looks of the image anytime. You ll have to decide whether it s worth it.
不管怎么说,我如何利用 j子这样做:
我不建议直接测试罗姆学生的价值的原因是,青年促进平等论坛抑制不同浏览器的行为可能略有不同。
您可使用SapnoramaByLocation功能(见。
试图这样做:
function handleMapClick()
{
var ll= new google.maps.LatLng(latitude,longitude);
sv.getPanoramaByLocation(ll, 50, processSVData);
}
function processSVData(data, status) {
if (status==google.maps.StreetViewStatus.ZERO_RESULTS)
{
<DO SOMETHING>
}
}
要求有一条眼光的街道观像,如果它有具体的档案规模,那就不是街头观。 我是这样说的:
var url = google street view url ;
var xhr = new XMLHttpRequest();
xhr.open( GET , url, true);
xhr.responseType = blob ;
xhr.onload = function (e) {
if (this.status == 200) {
try {
var image = new Blob([this.response], {type: image/jpeg });
if (image.size) {
if (url.indexOf( 640x640 ) > -1 && image.size === 8410) {
// Not street view
}
if (url.indexOf( 400x300 ) > -1 && image.size === 3946) {
// Not street view
}
}
} catch (err) {
// IE 9 doesn t support blob
}
}
};
xhr.send();
另一种办法是装上图像,然后比较一些颜色。 go角的“无街道观”形象总是一样的。 这里,你将如何比较2个图象:
var url = STREETVIEWURL
var img = new Image();
// Add some info to prevent cross origin tainting
img.src = url + ? + new Date().getTime();
img.setAttribute( crossOrigin , );
img.crossOrigin = "Anonymous";
img.onload = function() {
var context = document.createElement( CANVAS ).getContext( 2d );
context.drawImage(img, 0, 0);
//load 2 pixels. I chose the first one and the 5th row
var data1 = context.getImageData(0, 0, 1, 1).data;
var data2 = context.getImageData(0, 5, 1, 1).data;
console.log(data1);
// google unknown image is this pixel color [228,227,223,255]
if(data1[0]==228 && data1[1]==227 && data1[2]==223 && data1[3]==255 &&
data2[0]==228 && data2[1]==227 && data2[2]==223 && data2[3]==255){
console.log("NO StreetView Available");
}else{
console.log("StreetView is Available");
}
};
Some potential issues: I ve seen some errors with CrossOrigin tainting. Also, if google changes the image returned this code will break.
I have a QCView that loads a Quartz file which gives you iSights feedback (basically like a QTCaptureView) Everything displays fine The button simply takes a snapshot using the following simple ...
Is it possible to simply take a picture and save it somewhere using a QTCaptureView and Apple s built-in iSight? I ve seen lots of tutorials on recording video but none on simply taking a picture. Any ...
In .NET how can I transform an image into a trapezoid. The Matrix class supports rotation, shear, etc, but I can t see a trapezoidal transformation. I m using the usual System.Drawing.* API, but I m ...
What are my options for rotating an image on a web page through the Y-axis? I m not sure if I even have the terminology right. Is this called a rotate or a transform. Most of the searches that I ve ...
I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...
I m developing a new site that graphs some operational metrics. As such about a dozen charts/graphs will be displayed on the site. I want to be able to have them dynamically scale down (within ...
Is it possible to edit a xaml icons or images in the expression design or using other tools? Is it possible to import a xaml images (that e.g you have exported) in the expression designer for editing?...
I need to take a full color JPG Image and remap it s colors to a Indexed palette. The palette will consist of specific colors populated from a database. I need to map each color of the image to it s "...