I saw that the json response from google places returns a field photo_reference. Does anyone know how to get the image associated?
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"id" : "320d77fa60610f618058bd58b8ba46e340c615b8",
"name" : "The Meat & Wine Co",
"opening_hours" : {
"open_now" : true
},
"photos" : [
{
"height" : 968,
"html_attributions" : [],
"photo_reference" : "CoQBeQAAAAgOdveT3dRtzoJ42BTBZfCdZptWsqLN3bROkP4FVHNNX-qjxBiw0vdGpDaX_lVb3rcaQf5hBVvrEdMUMDKB2gcsIOaVNII_zLvY-5Kf4rOuTXElOgSHb5vxJoB-o70Oh0Bs-zxxUpHM0Ji_BPk2RpXoKdf8jG_QLPaulXWoC7TcEhDSLjj-4_l3hJpD0W_qBtoMGhT1MK1GRVFH1dnJolimMP7Z8a2tZA",
"width" : 1296
}
],
"rating" : 3.90,
google also providing place photo api to retrieve photo from google map using photo_reference
https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=photo_reference&key=AddYourOwnKeyHere
key :- pass your application api key here.
maxwidth & maxheight :- the maximum desired height or width when it will returned by api
photoreference :- pass your photo reference here.
send request to this api. and it will return you image.
image type will be depend upon the type of the originally submitted photo.
for more info goto :- https://developers.google.com/places/documentation/photos
I've been wondering the same thing. I read about the Picasa API, that seems like a logical storage place for these images.
UPDATED 03-13-2013
This feature has been released as part of the Places API. See the link for documentation. https://developers.google.com/places/documentation/photos
Interpolate the photo_reference value in a HTML img tag
var photo_reference_goes_here = ['icon']['photos'][0]['photo_reference']
<img class="rig-img" src="https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=photo_reference_goes_here&key=GOOGLE_KEY" alt="Pic From Google">
Related
The doc and its all fields are expanded by default, but I need it to be shrunk because it's huge. I couldn't find a setting in settings. (although I found the dark mode which is cool)
If you're talking about the Dev Tools tab:
Then afaik, the only thing to do is to limit the fields you're fetching.
ex.
GET /_search
{
"_source": "obj.*",
"query" : {
"term" : { "user" : "kimchy" }
}
}
ref --> Elasticsearch Page
But, if you're talking about the Discover tab, then you just need to press on the + on the fields on the left side to show only the selected ones.
hope that answers your question.
I want to restrict end user to upload multiple images using drag and drop feature, should not be greater than 1000 pixels wide. I have read http://docs.fineuploader.com/branch/master/features/validation.html
it's discuss fineuploader provide built-in validators for image dimensions.I have used image.maxWidth attribute but it's not work.
validation: {
allowedExtensions: ['jpeg','jpg','png', 'gif'],
maxWidth:1000,
},
Please suggest what i am doing wrong?
Thanks
I am doing wrong,the correct way is :
validation: {
allowedExtensions: ['jpeg','jpg','png', 'gif'],
image:{maxWidth:1000},
},
You can find more validation attribute details here :
http://docs.fineuploader.com/branch/hotfix_4.1.1/features/validation.html
Im not sure if Im missing something here.. but when I create a new data-type called Single Media Picker in umbraco 7 and uses the new Media Picker-property editor and keep the "multiple selections option" unchecked.. I am still able to select multiple images in the media picker-dialog..and once selected.. they all show up in my property-filed as well.. any ideas of why?.. guess its a bug in Umbraco.. and if thats the case.. anyone have a clue of how to limit the media-picker to a single selection for my own custom property editor?
Thanks in advance!
It depends a bit on how you use the media picker in your custom property editor. We're using the media picker in a completely separate tree for which we generate the JSON that yields the editor ourselves.
The property data that generates a single item picker looks a bit like this:
{
"label" : "Some Image",
"description" : "423 x 258px",
"view" : "mediapicker",
"config" : {
"multiPicker" : "0"
},
"hideLabel" : false,
"id" : 4,
"value" : "1092",
"alias" : "imageIdProperty"
}
Notice the config section. You could try to inspect the data that goes to the client and see what JSON is used to generate your picker.
I am currently using a full-screen image slider called supersized on a site, which references the images and associated extras in a script tag like so:
<script type="text/javascript">
jQuery(function($){
$.supersized({
// Functionality
property_1 : value,
property_2 : value,
slides : [
{image :'http://image1.jpg', title :'Name1', url :'1.html'},
{image :'http://image2.jpg', title :'Name2', url :'2.html'},
{image :'http://image3.jpg', title :'Name3', url :'3.html'},
],
// Options
option_1 : value,
option_1 : value
});
});
</script>
What would be very nice, is to be able to dynamically load a new array of images with their associated extras via ajax (jquery preferred, but vanilla js fine). Is this possible? If so, I've struggled to find any resources that explain how.
It seem that you need to code such feature youself.
See what plugin author is writing in FAQ: http://www.buildinternet.com/project/supersized/faq.html#q-4
Can I load different sets of slides without reloading the page?
This is a feature I am looking to develop out in the future. If you're hurting for it in the meantime, you can hire me for custom work.
If you need just one set of slides loaded by AJAX you can code it like that:
jQuery(function($){
$.ajax({
url: "URL"
}).done(function ( data ) {
$.supersized({
// Functionality
property_1 : value,
property_2 : value,
slides : data.slides,
// Options
option_1 : value,
option_1 : value
});
});
});
I'm sorry for my bad english but I hope you will understand.
What's my problem....
I wrote a code to simple show the form which contains textfields, htmleditors, comboboxes, etc. Everything goes fine but in Firefox my fields appears before the form layout is done. so it looks quite weird because form fields overlaps other components.
sample code:
positionsPanel = new Ext.FormPanel({
margins : '2 2 2 0',
frame : true,
flex : 3,
labelWidth : 220,
buttonAlign : 'right',
labelAlign : 'top',
autoScroll : true,
height : oldFormPanelHeight, //this is ok, just a value
autoShow : true,
defaults : {
enableKeyEvents : true,
anchor : '97%'
},
items : [{...etc.
Have you any idea how to fix that? Thanks a lot...
remove flex: 3
Note: this config is only used when this Component is rendered by a Container which has been configured to use a BoxLayout.
By default (in your case also) FormPanel use 'form' layout