Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

93 lines (77 sloc) 2.88 kB
import controlP5.*;
ControlP5 controlP5;
// Example for using the Google Maps Street View Scraper
// GPL 2011 Vincent Purcell <jadedoto@gmail.com>
//
// Enter the parameters of where we are starting.
String STREET_ADDRESS = "0 broadway new york city ny";
String DIRECTION_OF_TRAVEL = "UP"; // UP or DOWN, case-sensitive for now
int IMAGE_HEIGHT; // the height of images you want out of the extraction in pixels
int IMAGE_WIDTH; // the width of images you want out of the extraction in pixels
int NUMBER_OF_IMAGES; // the number of times you want to step up/down a street
String SAVE_FOLDER;
//Size of the final mosaic, ++in number of images!++:
int IMAGES_ACROSS = 10;
int IMAGES_DOWN = 10;
// Initialize our image... Using the values set above. Don't change this string.
googleMapImages sampleImage = new googleMapImages(STREET_ADDRESS, DIRECTION_OF_TRAVEL, IMAGE_HEIGHT, IMAGE_WIDTH, SAVE_FOLDER, NUMBER_OF_IMAGES);
Textfield save_folder_field;
Textfield mosaic_name;
Textfield address_field;
void setup() {
size(550, 500);
frameRate(25);
background(0);
controlP5 = new ControlP5(this);
controlP5.addSlider("Image Height", 10, 100, 25, 5, 5, 300, 50).setId(1);
controlP5.addSlider("Image Width", 10, 100, 25, 5, 65, 300, 50).setId(2);
controlP5.addSlider("Number of Images to Grab", 100, 1000, 100, 5, 125, 300, 50).setId(3);
address_field = controlP5.addTextfield("Starting Address", 5, 190, 300, 25);
mosaic_name = controlP5.addTextfield("Name your mosaic!", 5, 235, 300, 25);
mosaic_name.setText("default");
controlP5.addButton("Name it!", 1, 310, 235, 40, 25).setId(4);
save_folder_field = controlP5.addTextfield("Where to save your mosaic (default is current sketch folder)", 5, 280, 300, 25);
save_folder_field.setText(sketchPath("")+mosaic_name.getText());
controlP5.addButton("Build it!", 1, 310, 280, 40, 25).setId(5);
controlP5.addButton("Exit", 1, 510, 470, 35, 25).setId(6);
}
void draw() {
//sampleImage.walk(); // Walk down the street!
// Make the mosaic and save it:
//makeMosaic(SAVE_FOLDER);
// Done!
//exit();
}
void controlEvent(ControlEvent theEvent) {
switch(theEvent.controller().id()) {
case(1):
IMAGE_HEIGHT = (int)(theEvent.controller().value());
break;
case(2):
IMAGE_WIDTH = (int)(theEvent.controller().value());
break;
case(3):
NUMBER_OF_IMAGES = (int)(theEvent.controller().value());
break;
case(4):
nameIt();
break;
case(5):
buildIt();
break;
case(6):
exit();
break;
}
}
void buildIt() {
if ((address_field.getText().length() != 0) && address_field.getText().equals("PLEASE ENTER AN ADDRESS!") == false) {
println("Success!");
}
else {
address_field.setText("PLEASE ENTER AN ADDRESS!");
}
}
void nameIt() {
save_folder_field.setText(sketchPath("") + mosaic_name.getText());
}
Jump to Line
Something went wrong with that request. Please try again.