Closed eltaiguer closed 5 years ago
Can't access to https://s3.amazonaws.com/dishly/img/i/lot_of_shrimp_scampi/1_61689-thumb.jpg
.
All images must be public in order to access from this plugin.
Unfortunately, creating tons of waste code for try-catch
is too much job for me.
Please use this plugin as is
.
Yeah, I know, the thing is this kind of a piece of the bigger problem.
Here's what's happening although I can't really explain it. That url you can't access? I don't know where the addMarker method is getting it from. I have checked the urls I use by adding console logs to every call to addMarker, and that url should actually be: https://s3.amazonaws.com/dishly/img/d/i/lot_of_shrimp_scampi/1_61689-thumb.jpg
(which is valid) somewhere between the addMarker method and the output log of [fail] url = https://s3.amazonaws.com/dishly/img/i/lot_of_shrimp_scampi/1_61689-thumb.jpg
the url is missing a /d/
is the plugin doing any kind of processing on the urls?
How did you write your code?
You mean the code where I call the addMarker method?
for (const item of results) {
const url = item.img;
console.log(url);
this.map.addMarker({
icon: {
url: url,
size: {
width: 50,
height: 50
}
},
position: {
lat: item.loc[1],
lng: item.loc[0]
},
info: item
})
.then((marker) => this.markerClicked(marker))
.catch((error) => console.error(error));
}
Yeah, and please show me some results
.
results? what do you mean?
for (const item of results) {
oh yeah, sorry, my bad.
[
{
"dishId":"5936b43336329f0004849064",
"name":"Shrimp Scampi",
"descr":"Spinach, gnocchi, grilled ciabatta",
"price":20,
"url":"/d/Washington/Farmers_Fishers_Bakers/Shrimp_Scampi/5936b43336329f0004849064",
"loc":[
-77.05977648496628,
38.901677080420264
],
"img":"https://s3.amazonaws.com/dishly/img/d/i/lot_of_shrimp_scampi/1_61689-thumb.jpg",
"photo":"https://s3.amazonaws.com/dishly/img/d/i/lot_of_shrimp_scampi/1_61689-thumb.jpg",
"menu":"Lunch & Dinner",
"submenu":"Seafood Catch",
"venue":{
"vId":"55e4b400b04efbe04a139b49",
"name":"Farmers Fishers Bakers",
"url":"/v/Farmers_Fishers_Bakers/55e4b400b04efbe04a139b49",
"displayAddress":"3000 K St NW, Washington, D.C. 20007"
},
"rating":5,
"ratingSort":5,
"sort":"80-49990-Shrimp Scampi",
"nbRatings":4
},
{
"dishId":"57d4382a4bcc3f03006af910",
"name":"Palak Chaat",
"descr":"Crispy baby spinach, sweet yogurt, tamarind, date chutney",
"url":"/d/Washington/Rasika_West_End/Palak_Chaat/57d4382a4bcc3f03006af910",
"loc":[
-77.04807937145233,
38.90506478729127
],
"img":"https://s3.amazonaws.com/dishly/img/d/i/palak_chaat/5_87014-thumb.jpg",
"photo":"https://s3.amazonaws.com/dishly/img/d/i/palak_chaat/5_87014-thumb.jpg",
"menu":"Tasting",
"submenu":"Grand (Four Courses) - First Course",
"venue":{
"vId":"5612b561edb2c2b9500c7882",
"name":"Rasika West End",
"url":"/v/Rasika_West_End/5612b561edb2c2b9500c7882",
"displayAddress":"1190 New Hampshire Ave NW, Washington, D.C. 20037"
},
"rating":4.2,
"ratingSort":4.2,
"sort":"80-41770-Palak Chaat",
"nbRatings":21
},
{
"dishId":"5a1360a160d21d000431418b",
"name":"Margherita",
"url":"/d/Washington/FoBoGro/Margherita/5a1360a160d21d000431418b",
"loc":[
-77.04815575565883,
38.89737202606131
],
"img":"https://s3.amazonaws.com/dishly/img/d/i/margarita_pizza/7_86167-thumb.jpg",
"photo":"https://s3.amazonaws.com/dishly/img/d/i/margarita_pizza/7_86167-thumb.jpg",
"menu":"Main (discovered items)",
"submenu":"Food",
"venue":{
"vId":"5731d1ab1655d5aa84779ff4",
"name":"FoBoGro",
"url":"/v/FoBoGro/5731d1ab1655d5aa84779ff4",
"displayAddress":"2140 F St NW, Washington, D.C. 20037"
},
"rating":4.1,
"ratingSort":4.1,
"sort":"80-40930-Margherita",
"nbRatings":0
},
{
"dishId":"57d2c78088910c030032e296",
"name":"Uncle Buck's Beignets",
"descr":"With raspberry, chocolate & caramel sauces",
"price":9.5,
"url":"/d/Washington/Founding_Farmers/Uncle_Buck_s_Beignets/57d2c78088910c030032e296",
"loc":[
-77.0445193853609,
38.90057336898503
],
"img":"https://s3.amazonaws.com/dishly/img/d/i/beignets/3_34948-thumb.jpg",
"photo":"https://s3.amazonaws.com/dishly/img/d/i/beignets/3_34948-thumb.jpg",
"menu":"Breakfast and Brunch Menu",
"submenu":"Share Plates",
"venue":{
"vId":"55e4b400b04efbe04a139b52",
"name":"Founding Farmers",
"url":"/v/Founding_Farmers/55e4b400b04efbe04a139b52",
"displayAddress":"1924 Pennsylvania Ave NW, Washington, D.C. 20006"
},
"rating":4.1,
"ratingSort":4.1,
"sort":"80-40700-Uncle Buck's Beignets",
"nbRatings":8
}
]
Hi, is this going to be released?
You can install this plug-in from this GitHub repository directly.
I meant the commit you added with the fix
You need to install from GitHub repository directly until I release next version.
Cool, thanks 👍
v2.6.1 has been released.
I'm submitting a ... (check one with "x")
OS: (check one with "x")
cordova information: (run
$> cordova plugin list
)If you use
@ionic-native/google-maps
, please tell the package.json (only@ionic-native/core
and@ionic-native/google-maps
are fine mostly)Current behavior: Sometimes when adding markers with a custom icon, I get a message that it failed loading the url. Right after that I get the following message:
Terminating app due to uncaught exception 'GMSThreadException', reason: 'The API method must be called from the main thread'
If wrap the marker code with a try-catch, the app still crashesExpected behavior: The try-catch block should catch the exception and the app shouldn't crash if it fails to load the marker url.
Related code, data or error log (please format your code or data): Xcode log
Support this plugin activity
I appreicate if you give me a beer :beer: from here