How can I customise the position icon? - skmaps

I am trying to replace the position icon in the demo with my own but I haven't managed to figure out how.
I searched for it's declaration in the .json file and had no success.
{
"class" : "map",
"colortype" : "rgba",
"columns" : 1,
"filename" :
[
"route_arrow.png",
"route_arrow.png",
"route_arrow.png",
"route_arrow.png",
"route_arrow.png",
"route_arrow.png"
],
"rows" : 1,
"textureatlas" :
[
{
"textureheight" : [ 128, 128, 128, 128, 128, 128 ],
"textureid" : 55,
"texturelinear" : true,
"texturelocation" : [ 0, 0 ],
"texturename" : "route_arrow",
"texturewidth" : [ 128, 128, 128,128, 128, 128 ]
}
]
},

The icon for the position is found in the apps SKMapsResources -> SKMaps.bundle-> MapResources-> Common. There are a number of icons that are used :
Here are all instances:
-ccp_2d,
ccp_2d#2x,
ccp_2d#3x,
ccpmedium_2d,
ccpmedium_2d#2x,
ccpmedium_2d#3x,
ccpsmall_2d,
ccpsmall_2d#2x,
ccpsmall_2d#3x, these icons form the resources for the 2D view.
-ccp_3d,
ccp_3d#2x,
ccp_3d#3x, these icons form the resources for the 3D view.
To change the position icon you have to replace these pngs with the ones you want.
Make sure that all your new icons are exactly the same size (the same pixel density, for example: 32x32,64x64,etc) as the original and that their colours are only RGB.

Related

convert 3d geometry to gltf

** Ask through a translator.
I want to express 3d geometry in gltf. (want to use in cesium js)
Fist, convert the coordinates to ECEF coordinates.
Next, I created a gltf file.
However, it does not look neat on the preview screen. (ms code extension)
And trembling occurs when moving.
I want to know the cause.
** coordinates (epsg 4326)
-73.561001356474, 45.4966833629139, 19.9
-73.5610780383518, 45.4967314096038, 19.9
-73.5610843141094, 45.4967252603133, 19.9
-73.561001356474, 45.4966833629139, 19.9
** preview gltf (ms code extension)
enter image description here
** gltf source
{
"scenes" : [
{
"nodes" : [ 0 ]
}
],
"nodes" : [
{
"mesh" : 0
}
],
"meshes" : [
{
"name": "gltf test",
"primitives" : [
{
"attributes" : {
"POSITION" : 1
},
"indices" : 0,
"mode": 4
}
]
}
],
"buffers" : [
{
"uri" : "data:application/octet-stream;base64,AAABAAIAAAAYtZpJTBWDyiIhikritJpJSBWDyiohikrftJpJSRWDyikhiko=",
"byteLength" : 44
}
],
"bufferViews" : [
{
"buffer" : 0,
"byteOffset" : 0,
"byteLength" : 6,
"target" : 34963
},
{
"buffer" : 0,
"byteOffset" : 8,
"byteLength" : 36,
"byteStride": 12,
"target" : 34962
}
],
"accessors" : [
{
"bufferView" : 0,
"byteOffset" : 0,
"componentType" : 5123,
"count" : 3,
"type" : "SCALAR"
},
{
"bufferView" : 1,
"byteOffset" : 0,
"componentType" : 5126,
"count" : 3,
"type" : "VEC3",
"min" : [ 1267355.8953368044, -4295333.93970134, 4526225.02467026],
"max" : [ 1267363.054331189, -4295331.983019848, 4526228.767742585]
}
],
"asset" : {
"version" : "2.0"
}
}
You haven't shared how you created this file, so we can't really tell you the cause of the issue. I would recommend adding enough information to fully reproduce the problem. But importantly, the file you've shared has only three vertices. Try inspecting it in VS Code's glTF addon.

Display the documents with partial matching of field value in mongodb

The below is my movie schema:
"_id" : ObjectId("59b9501600fcb397d6acd5bb"),
"theatreid" : 2,
"name" : "carnival cinemas",
"location" : "kanjulmarg",
"address" : "sec 2,kanjul, Mumbai, Maharashtra 400703",
"shows" : [
{
"mname" : "bareily ki barfi",
"timings" : [
10,
13,
14,
16,
22
]
},
{
"mname" : "Toilet:ek prem katha",
"timings" : [
8,
9,
14,
16,
20,
23
]
}
]
"_id" : ObjectId("59b9506500fcb397d6acd5bc"),
"theatreid" : 3,
"name" : "pheonix pvr",
"location" : "kurla",
"address" : "sec 26,kurla, Mumbai, Maharashtra 400701",
"shows" : [
{
"mname" : "shubh mangal savdhan",
"timings" : [
9,
11,
15,
18,
20
]
},
{
"mname" : "Toilet:ek prem katha",
"timings" : [
8,
9,
14,
16,
20,
23
]
}
]
My query is to display all the theaters having show timing (shows.timings) greater than 20 and the location is kurla.I am using nodeJS.
The query is as follows:
user.aggregate([{$match:{"location":"kurla"}},{"$addFields": {"shows": {"$map": {"input": "$shows","as": "resultm","in": {"name": "$$resultm.name","mname": "$$resultm.mname","timings": {"$filter": {"input": "$$resultm.timings","as": "resultf","cond": {"$gte": ["$$resultf",10]}}}}}}}}])
This works fine when it gets the exact match where location="kurla",but i want that it should also work and display the same records even if location=kurla east,maharashthra,mumbai.That is even if a partial match is found in the location attribute of my collection.How can this be done!Please help. Thanks:)
Use the $regex operator to apply a partial text match on the location attribute.
Replace this ...
{$match:{"location":"kurla"}}
... with this:
{ $match: {location: { $regex: /^kurla/ } } }
In the above example the condition is location like 'kurla%'.
More details in the docs.
This presumes that the values you wish to filter on are all in the location field, this is consistent with the following statement from your question:
location=kurla east,maharashthra,mumbai
There are no examples of "maharashthra" or "mumbai" in the location field in the example documents you showed however "maharashthra" does appear in the address attribute so if your filter is actually to be applied to location and/or address then the solution will be different to what I have posted above. If this is the case, perhaps you could update your question to clarify.

What tools to use to visualize logical and physical query plans?

I am familiar explain() (also WebUI). I was curious whether there are any tools that generate an image of the tree structure of the logical/physical plan before/after optimizations. That is the information returned by explain() as an image.
A picture like a PNG or JPG? Never heard of one myself, but you can see the physical plan using web UI (that you've already mentioned).
The other phases of query execution are available using TreeNode methods which (among many methods that could help you out) give you my favorite numberedTreeString.
scala> println(q.queryExecution.analyzed.numberedTreeString)
00 Range (0, 5, step=1, splits=Some(8))
scala> println(q.queryExecution.executedPlan.numberedTreeString)
00 *Range (0, 5, step=1, splits=8)
You can save the output as JSON using toJSON or prettyJson to generate PNG (but I've never tried it out myself).
scala> println(q.queryExecution.executedPlan.prettyJson)
[ {
"class" : "org.apache.spark.sql.execution.WholeStageCodegenExec",
"num-children" : 1,
"child" : 0
}, {
"class" : "org.apache.spark.sql.execution.RangeExec",
"num-children" : 0,
"range" : [ {
"class" : "org.apache.spark.sql.catalyst.plans.logical.Range",
"num-children" : 0,
"start" : 0,
"end" : 5,
"step" : 1,
"numSlices" : 8,
"output" : [ [ {
"class" : "org.apache.spark.sql.catalyst.expressions.AttributeReference",
"num-children" : 0,
"name" : "id",
"dataType" : "long",
"nullable" : false,
"metadata" : { },
"exprId" : {
"product-class" : "org.apache.spark.sql.catalyst.expressions.ExprId",
"id" : 0,
"jvmId" : "cb497d01-3b90-42a7-9ebf-ebe85578f763"
},
"isGenerated" : false
} ] ]
} ]
} ]

Is there any way to get artworks for artists/albums/songs using spotify web api? [duplicate]

There is currently no way to retrieve the cover artwork using Spotify's Web API. Are there plans to implement these or any workarounds?
June 17th 2014:
Today Spotify released a new Web API.
It is now easy to retrieve cover artwork, as all endpoints includes an array of images for every item.
Search example:
curl -X GET "https://api.spotify.com/v1/search?q=tania%20bowra&type=artist"
{
"artists" : {
...
"items" : [ {
...
"images" : [ {
"height" : 640,
"url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718",
"width" : 640
}, {
"height" : 300,
"url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55",
"width" : 300
}, {
"height" : 64,
"url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4",
"width" : 64
...
} ],
...
}
}
Old Answer:
You can get the URL to the cover art by calling Spotify's oEmbed service:
https://embed.spotify.com/oembed/?url=spotify:track:6bc5scNUVa3h76T9nvpGIH
https://embed.spotify.com/oembed/?url=spotify:album:5NCz8TTIiax2h1XTnImAQ2
https://embed.spotify.com/oembed/?url=spotify:artist:7ae4vgLLhir2MCjyhgbGOQ
With JSONP:
https://embed.spotify.com/oembed/?url=spotify:artist:7ae4vgLLhir2MCjyhgbGOQ&callback=callme
http://open.spotify.com/ urls work as well:
https://embed.spotify.com/oembed/?url=http://open.spotify.com/track/6bc5scNUVa3h76T9nvpGIH
{
"provider_url": "https:\/\/www.spotify.com",
"version": "1.0",
"thumbnail_width": 300,
"height": 380,
"thumbnail_height": 300,
"title": "Gusgus - Within You",
"width": 300,
"thumbnail_url": "https:\/\/d3rt1990lpmkn.cloudfront.net\/cover\/f15552e72e1fcf02484d94553a7e7cd98049361a",
"provider_name": "Spotify",
"type": "rich",
"html": "<iframe src=\"https:\/\/embed.spotify.com\/?uri=spotify:track:6bc5scNUVa3h76T9nvpGIH\" width=\"300\" height=\"380\" frameborder=\"0\" allowtransparency=\"true\"><\/iframe>"
}
Notice the thumbnail_url:
https://d3rt1990lpmkn.cloudfront.net/cover/f15552e72e1fcf02484d94553a7e7cd98049361a
/cover/ represents the size of the thumbnail.
Available sizes: 60, 85, 120, 140, 160, 165, 230, 300, 320, and 640.
eg: https://d3rt1990lpmkn.cloudfront.net/640/f15552e72e1fcf02484d94553a7e7cd98049361a
There are plans to implement it, as in, we want it to be there, but nobody is working on it. It is mostly a legal problem with terms of use.
Technically, it is of course possible to figure it and access the same images that for instance open.spotify.com uses by parsing html. That is not allowed of course, but there is nothing technically that stops access.
(I work at Spotify)
The iTunes and Deezer API are also useful :
http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
http://developers.deezer.com/api/search

YUI paginator infinity records in table

I am using YUI for displaying data.
This row is used for set count of records per page:
rowsPerPageOptions : [ 10, 25, 50, 100 ]
Does it have ability to set infinity number of records?
Try just [ 20, 50, 100, 250, 500, 1000, 'all' ]
Resolved using custom page count names and max int.
rowsPerPageOptions : [
{ value : 20, text : '20' },
{ value : 50, text : '50' },
{ value : 100, text : '100' },
{ value : 250, text : '250' },
{ value : 500, text : '500' },
{ value : 1000, text : '1000' },
{ value : 9007199254740992, text : 'All' }],

Resources