How can I use a map in UI5 GeoMap? - api

I should use the basemap.at free online map to my SAPUI5 application. I can't achieve, to use it.
var oMapConfig = {
"MapProvider": [{
"name": "GMAP",
"Source": [{
"id": "s1",
"url": 'https://maps3.wien.gv.at/basemap/bmaphidpi/normal/google3857/9/178/278.jpeg?api_key=a73befc7-575f-48cb-8eb9-b05172a8c9e3'
}]
}],
I don't where could I find the good URL, or what should I set in.
Tried to find the API and other hints, but didn't find any solution and I don't know how could I do it. I think it's easy (basemap.at, wien.gv.at, data.gv.at) but I don't know what to do.
I tried it with Google Maps, with this URL: https://mt.google.com/vt/lyrs=s&x={X}&y={Y}&z={LOD} and it works well.

Following #BoghyonHoffmann suggestion, I believe you should use the following url:
https://maps3.wien.gv.at/basemap/bmaphidpi/normal/google3857/{LOD}/{X}/{Y}.jpeg?api_key=a73befc7-575f-48cb-8eb9-b05172a8c9e3
Also you could make use of all of available sources:
var oMapConfig = {
"MapProvider": [{
"name": "GMAP",
"Source": [{
"id": "s0",
"url": "https://maps.wien.gv.at/basemap/bmaphidpi/normal/google3857/{LOD}/{X}/{Y}.jpeg?api_key=a73befc7-575f-48cb-8eb9-b05172a8c9e3"
},{
"id": "s1",
"url": "https://maps1.wien.gv.at/basemap/bmaphidpi/normal/google3857/{LOD}/{X}/{Y}.jpeg?api_key=a73befc7-575f-48cb-8eb9-b05172a8c9e3"
},{
"id": "s2",
"url": "https://maps2.wien.gv.at/basemap/bmaphidpi/normal/google3857/{LOD}/{X}/{Y}.jpeg?api_key=a73befc7-575f-48cb-8eb9-b05172a8c9e3"
},{
"id": "s3",
"url": "https://maps3.wien.gv.at/basemap/bmaphidpi/normal/google3857/{LOD}/{X}/{Y}.jpeg?api_key=a73befc7-575f-48cb-8eb9-b05172a8c9e3"
},{
"id": "s4",
"url": "https://maps4.wien.gv.at/basemap/bmaphidpi/normal/google3857/{LOD}/{X}/{Y}.jpeg?api_key=a73befc7-575f-48cb-8eb9-b05172a8c9e3"
}]
}],

Related

Need help forming valid "citation" data in schema.org structure

I'm struggling to understand how to properly format the citation property for Articles on a website. The documentation only indicates it accepts Text or CreativeWork types, but how would I add multiple? Can I make it an array?
Right now I have something like this:
[{
"#context": "http:\/\/schema.org",
"#type": "Article",
"mainEntityOfPage": {
"#type": "WebPage",
"#id": "https:\/\/bhamrick.com\/article-url\/"
},
"url": "https:\/\/bhamrick.com\/article-url\//",
"headline": "Article Title",
"description": "This is an excerpt from the article",
"image": {
"#type": "ImageObject",
"url": "https:\/\/cdn.bhamrick.com\/article-image.jpg",
"width": 1200,
"height": 628
},
"datePublished": "2019-12-10T18:10:23-08:00",
"dateModified": "2020-02-26T18:24:00+00:00",
"author": {
"#type": "Person",
"name": "Bryce Hamrick",
"url": "",
"description": "This is my bio.",
"sameAs": ["https:\/\/bhamrick.com\/", "https:\/\/twitter.com\/https:\/\/twitter.com\/bhamrick"]
},
"publisher": {
"#type": "Organization",
"#id": "https:\/\/bhamrick.com\/#organization",
"name": "Bryce Hamrick",
"logo": {
"#type": "ImageObject",
"#id": "https:\/\/bhamrick.com\/#logo",
"url": "https:\/\/cdn.bhamrick.com\/logo.png",
"width": 600,
"height": 60
},
"image": {
"#type": "ImageObject",
"#id": "https:\/\/bhamrick.com\/#logo",
"url": "https:\/\/cdn.bhamrick.com\/logo.png",
"width": 600,
"height": 60
}
},
"articleSection": "Article Category",
"keywords": "",
"wordCount": 5151,
"citation": []
}]
For the "citation" property, should I change it to look like this?
"citation: [
{
"#type": "CreativeWork",
"sameAs": "https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/01234567\/"
}, {
"#type": "CreativeWork",
"sameAs": "https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/567891011\/"
}
]
What other data is beneficial to include for crawlers like Google?
If you test your code (with the citation array) on the Structured Data Testing Tool - it will come through as valid. Making citation an array is acceptable there, so I'd say that's a fine way to handle it.
As far as what else you can add to each CreativeWork, that would depend on what each CreativeWork is. For that you can reference what is available at the schema.org specification for CreativeWork.
I'd note that while Google validates citation in your example, there's not much about it on Google Structured Data Documentation. Even if it's a good structured data practice, you may not gain much SEO benefit from this - but that's a better question to bring up on Webmasters Stack Exchange.
Just to chime in, I'm using the 'url' property, I think that's more accurate for this purpose, although both are probably valid.
My logic is: If you haven't defined something, how can it be the 'sameAs' something else?
"citation: [
{
"#type": "CreativeWork",
"url": "https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/01234567\/"
}, {
"#type": "CreativeWork",
"url": "https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/567891011\/"
}
]

Bigcommerce Stencil Common Product Card Model has_options attribute not working

According to the documentation, there is a has_options attribute on the Common Product Card Model that should return a boolean showing whether or not the product has options.
However, this value is returning false for all of my products, even though they have options. For example, if I access the homepage in debug mode via this url:
http://localhost:3000/?debug=context
One of the products under the featured products section is:
{
"id": 114,
"name": "Product Name",
"url": "http://www.example.com/product-url",
"brand": null,
"rating": 5,
"availability": "Usually ships the next business day",
"summary": "Product summary goes here",
"image": {
"data": "https://cdn2.bigcommerce.com/server2100/abcdef/images/stencil/{:size}/products/114/8086/product_image.jpg?c=2",
"alt": ""
},
"date_added": "January 6, 2014",
"qty_in_cart": 0,
"pre_order": false,
"has_options": false,
"show_cart_action": false,
"add_to_wishlist_url": "/wishlist.php?action=add&product_id=114",
"price": {
"without_tax": {
"formatted": "$19.99",
"value": 19.99
},
"rrp_without_tax": {
"formatted": "$24.99",
"value": 24.99
},
"saved": {
"formatted": "$5.00",
"value": 5
},
"tax_label": "Tax"
}
}
As you can see has_options is false. However, this product does have options. Via the control panel, I can see that it has a color swatch option. I can also see this by navigating to the products page in debug mode at http://localhost:3000/product-url?debug=context. As you can see, part of the output contains the options information for that product:
"options": [
{
"id": 498,
"type": "Configurable_PickList_Swatch",
"display_name": "Color",
"required": true,
"condition": true,
"values": [
{
"label": "Powder Coat Black",
"id": 390,
"data": [
"000000"
],
"selected": false
},
{
"label": "Anodized Aluminum",
"id": 391,
"data": [
"D9D9D9"
],
"selected": false
}
],
"partial": "swatch"
}
],
As you can see, the product does in fact have options, yet the Common Product Card Model for this product shows has_options as false.
Is there some other setting that is effecting the output of has_options? Why would it be showing false for a product that has options?
has_options is used to denote something is purchasable (true) or not (false). This is misleading and documentation will be revised to reflect this.

Instagram API and Pagination

I can't get all images using Instagram API, Pagination seems to be working somehow different and I can't understand it yet
I use request:
https://api.instagram.com/v1/users/self/media/recent?access_token=TOKEN
and can get first 20 photos:
...
{
"attribution": null,
"tags": [
"beautiful",
"instalife",
"picoftheday",
"beauty",
"instalike",
"gf",
"traveling",
"instatravel",
"vsco",
"tourism",
"\u0438\u0441\u043f\u0430\u043d\u0438\u044f",
"travelphoto",
"vscogood",
"instafollow",
"travel",
"\u0433\u0440\u0430\u043d\u0430\u0434\u0430",
"amazing",
"vscocam",
"followme",
"photooftheday"
],
"type": "image",
"location": null,
"comments": {
"count": 1
},
"filter": "Normal",
"created_time": "1442825564",
"link": "https:\/\/instagram.com\/p\/74vm3GOCEn\/",
"likes": {
"count": 18
},
"images": {
"low_resolution": {
"url": "https:\/\/scontent.cdninstagram.com\/hphotos-xap1\/t51.2885-15\/s320x320\/e15\/11934647_531283580370186_1131008999_n.jpg",
"width": 320,
"height": 320
},
"thumbnail": {
"url": "https:\/\/scontent.cdninstagram.com\/hphotos-xap1\/t51.2885-15\/s150x150\/e15\/11934647_531283580370186_1131008999_n.jpg",
"width": 150,
"height": 150
},
"standard_resolution": {
"url": "https:\/\/scontent.cdninstagram.com\/hphotos-xap1\/t51.2885-15\/e15\/11934647_531283580370186_1131008999_n.jpg",
"width": 612,
"height": 612
}
},
"users_in_photo": [
],
"caption": {
"created_time": "1442825564",
"text": "#\u0413\u0440\u0430\u043d\u0430\u0434\u0430 #\u0418\u0441\u043f\u0430\u043d\u0438\u044f #photooftheday #picoftheday #instalike #followme #vscogood #vscocam #vsco #instafollow #travel #traveling #instatravel #instalife #tourism #gf #beauty #beautiful #amazing #travelphoto",
"from": {
"username": "solotravel_me",
"profile_picture": "https:\/\/igcdn-photos-h-a.akamaihd.net\/hphotos-ak-xaf1\/t51.2885-19\/11282631_115839268762391_863189534_a.jpg",
"id": "736938591",
"full_name": "and"
},
"id": "1078821495951073761"
},
"user_has_liked": false,
"id": "1078821489441513767_736938591",
"user": {
"username": "solotravel_me",
"profile_picture": "https:\/\/igcdn-photos-h-a.akamaihd.net\/hphotos-ak-xaf1\/t51.2885-19\/11282631_115839268762391_863189534_a.jpg",
"id": "736938591",
"full_name": "and"
}
}
...
after that I'm trying use max_id parameter, but I'm not sure which ID I need to use
I tried id of the photo, photo_user id, I even tried timestamp (found this idea on some forum), but every time I receive only first 20 photos
example:
https://api.instagram.com/v1/users/self/media/recent?access_token=TOKEN&max_id=1078821495951073761
I was having the same problem with the empty pagination object while the account actually had more photos.
And just to make things clear here. This question is answered in the comments of the origial question.
There is nothing in the pagination object because the app is in sandbox mode and app's in sandbox mode never returns more than 20 posts(photos).
Use this API for getting all posts of the user:
https://i.instagram.com/api/v1/feed/user/{user_id}
For pagination, the parameter name is max_id
Pass max_id which you have returned in this API's response.
Hope this helps !!

How to get number of googleplus page followers?

is there actually a possibility to get the number of followers of my googleplus-page. the following script - which I found here in an earlier post - doesn't work (no output):
$google_api_key = 'XYZXYZXYZXYZXYZXYZ';
$page_id = 'MYNUMERICPAGEID';
$data = #file_get_contents("https://www.googleapis.com/plus/v1/people/$page_id?key=$google_api_key");
$data = json_decode($data, true);
echo $data['plusOneCount'];
thank you!
There could be a few things wrong:
Don't have an updated project on the Developer Console.
Didn't enable the API for that project.
Are past thresholds/quotas.
Try the following:
Login to your Google Developers Console
You'll need a project.
If you don't have a project, create one.
Enable "Google Plus API" on that project.
Confirm usage/quotes are within tolerance and you haven't gone past.
From there, your call should work as normal:
GET https://www.googleapis.com/plus/v1/people/{USER_ID}?key={YOUR_API_KEY}
In my case, I'm querying Google's's page, so {USER_ID} = 116899029375914044550. I can then see the plusOneCount:
{
"kind": "plus#person",
"etag": "\"RqKWnRU4WW46-6W3rWhLR9iFZQM/bTf-sq_Sg3fLAFijixPfjtKM5f8\"",
"urls": [
{
"value": "http://www.google.com",
"type": "website",
"label": "www.google.com"
},
{
"value": "http://www.google.com/support/",
"type": "other",
"label": "Google Help"
},
{
"value": "http://googleblog.blogspot.com/",
"type": "other",
"label": "Official Blog"
},
{
"value": "http://twitter.com/#!/google",
"type": "other",
"label": "#google"
},
{
"value": "http://www.google.com/about/corporate/company/",
"type": "other",
"label": "Company Info"
},
{
"value": "http://www.google.com/press/",
"type": "other",
"label": "News"
},
{
"value": "http://www.google.com/press/google-directory.html",
"type": "other",
"label": "More Google pages"
}
],
"objectType": "page",
"id": "116899029375914044550",
"displayName": "Google",
"tagline": "News and updates on Google's products, technology and more",
"aboutMe": "<p>Welcome to Google's official page. Here, you'll find product news and announcements, company updates, glimpses into what it's like to work at Google, discussions on technology and the web, and much more. </p><p><span>Given the volume of feedback we receive here, we may not be able to respond individually to every comment and we're not able to provide product support (if you're having product issues, please visit our Help Center). Rest assured we're paying attention, and we're always eager to hear from you.</span></p>",
"url": "https://plus.google.com/+google",
"image": {
"url": "https://lh4.googleusercontent.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAC9wQ/JD8tdz3bFTM/photo.jpg?sz=50",
"isDefault": false
},
"isPlusUser": true,
"plusOneCount": 10757884,
"circledByCount": 7692912,
"verified": true,
"cover": {
"layout": "banner",
"coverPhoto": {
"url": "https://lh4.googleusercontent.com/-PLPoXvnN0XI/UTdr4xTtuHI/AAAAAAAA_1U/p1n_Za3BZUg/s630-fcrop64=1,00000000fe06fe97/g_plus_background.png",
"height": 528,
"width": 940
},
"coverInfo": {
"topImageOffset": 0,
"leftImageOffset": 0
}
}
}

Swagger integration into Dropwizard

I am fairly new to drop wizard (dropwizard.io) & just completed their tutorial. I would like to integrate Swagger (swagger.io) into this sample app.
I found:
github.com/federecio/dropwizard-swagger-sample-app
github.com/federecio/dropwizard-swagger
The generated JSON seems to be quite similar, however I cannot expand the REST resources to see their respective operations.
The only difference I noted was that the example code of the swagger integration uses SERVER whereas the official drop wizard example is using APPLICATION
Here an Image (i.stack.imgur.com/QzhPa.png)
Please could you tell me what is wrong in my approach.
Thank you very much. Here is the code to my approach: https://github.com/geoHeil/dropwizardSwaggerIntegrationNotWorking
Edit:
for api - docs {
"apiVersion": "0.0",
"swaggerVersion": "1.2",
"apis": [{
"path": "/sample"
}, {
"path": "/hello-world",
"description": "Operations about greetings"
}]
}
for sample {
"apiVersion": "0.0",
"swaggerVersion": "1.2",
"basePath": "http://geoHeil.local:8080",
"resourcePath": "/sample",
"apis": [{
"path": "/sample",
"operations": [{
"method": "GET",
"summary": "Sample endpoint",
"notes": "",
"type": "void",
"nickname": "get",
"authorizations": {},
"parameters": []
}]
}, {
"path": "/sample/hello-with-path-param/{name}",
"operations": [{
"method": "GET",
"summary": "Sample endpoint with path param",
"notes": "",
"type": "void",
"nickname": "getWithPathParam",
"authorizations": {},
"parameters": [{
"name": "name",
"required": true,
"type": "string",
"paramType": "path"
}]
}]
}, {
"path": "/sample/hello-with-query-param",
"operations": [{
"method": "GET",
"summary": "Sample endpoint with query param",
"notes": "",
"type": "void",
"nickname": "getWithQueryParam",
"authorizations": {},
"parameters": [{
"name": "name",
"required": false,
"type": "string",
"paramType": "query"
}]
}]
}]
}
for hello - world {
"apiVersion": "0.0",
"swaggerVersion": "1.2",
"basePath": "http://geoHeil.local:8080",
"resourcePath": "/hello-world",
"apis": [{
"path": "/hello-world",
"operations": [{
"method": "GET",
"summary": "Greetings endpoint",
"notes": "",
"type": "void",
"nickname": "sayHello",
"authorizations": {},
"parameters": [{
"name": "name",
"required": false,
"items": {
"type": "string"
},
"paramType": "query"
}]
}]
}]
}
There is now a Swagger spec 2.0 example available:
https://github.com/swagger-api/swagger-samples/tree/master/java/java-dropwizard
This uses the latest swagger core libraries with minimal dependencies. Note, the version of Jackson needed to be updated from dropwizard's 2.3.2 to swagger's 2.4.2.
I don't see anything obvious in the generated JSON that would cause the operations to not expand.
However, the swagger-ui bundled with the dropwizard-swagger package is a bit old. I would try using the newer version of swagger-ui.
I'm not sure if it would conflict with the bundled swagger-ui or not, but basically you need to clone https://github.com/swagger-api/swagger-ui and copy the /dist directory to your static content.
Another option is to run the swagger-ui locally (just for testing purposes) but opening the /dist/index.html and pointing it at your /api-docs directory. However, in order for that to work properly, you'd need to enable CORS - https://github.com/swagger-api/swagger-ui#cors-support.
EDIT:
I didn't notice you edited the question with the JSON, and it made it easier to read.
There's a problem with the GET /hello-world operation. It looks like it's supposed to accept an array of strings as a query parameter, but the parameter is missing a "type": "array" in its definition. I can't say what may be causing it without seeing the method's declaration and its annotations, but that's what you should be looking at.