How can I add a route to a UI5 geomap using js? I didn't find anything in the samples or the documentation.
Has it something to do with the method addGeoJsonLayer()?
Thanks in advance for your help :)
I found a way to do it. You have to create a VO Object as it is outlined here: https://sapui5.hana.ondemand.com/test-resources/sap/ui/vbm/bestpractices.html
then add it using addVo()
like it is outlined here https://sapui5.hana.ondemand.com/docs/api/symbols/sap.ui.vbm.GeoMap.html#addVo
Example:
var oRouteCollection = new sap.ui.vbm.Routes
next
oGeoMap.addVo(oRouteCollection);
Source: Sygyzmundovych
My walk during QCon London 2018
Related
I'm working on this WP plugin and I've been trying to get the ID of a custom post kinda thing that is declared in the body class on each page. So it goes like this;
<body class="(Bunch of other classes) ld-courses-1731-parent">
I'm trying to get the number 1731 in my JS function but the number is dynamic so I need to some regex matching with the string pattern.
Pattern: ld-courses-*INT VALUE*-parent
how can I do this with JS? Any help is much appreciated thank you so much.
You can use match if thats the only class in your body:
var classList = document.getElementsByTagName("body")[0].classList;
[...classList].forEach(function(thisClass) {
if (/ld-courses-\b/.test(thisClass)) {
var id = thisClass.match(/\d/g);
console.log(id.join(""));
}
});
<body class="another-class-before another-class-12-hasnum ld-courses-1731-parent another-class-12-hasnumaswell another-class-after">
</body>
Hi Laclogan in regards to your question yes it's possible for sure.
Correct me if i'm wrong but the number comes probably if it's changing for each post directly from the url.
The following site explains if this is the case how to get that number from the url.
https://www.sitepoint.com/get-url-parameters-with-javascript/
In addition you can use the function concat to combine the strings see this site for an example hope it helps.
https://www.w3schools.com/jsref/jsref_concat_string.asp
Could you confirm for me that the number is always present in the url or if this is not the case?
In Ext.picker.Date or datePicker we can set this as shown in below code.
var dateField=new Ext.form.DateField({
startDay: 1
});
But i am unable to do the same in dateMenu.Can anyone help me out with this.
did you try picker property?
http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.menu.DateMenu (under property)
It works fine for me, see the fiddle.
To quote the documentation:
Notes:
Although not listed here, the constructor for this class accepts all of the configuration options of Ext.picker.Date.
I have the following code in javascript:
var c = new addon.Component();
c.ComponentLength = 3
How should i build my addon, so i can do the previous code? I've already followed the tutorials in http://nodejs.org/api/addons.html , but i'm stuck here.
Is this possible? Does anyone have a solution?
Thanks in advance.
The solution is on the v8.h, search for SetAccessor , which "Sets an accessor on the object template.".
An example: http://syskall.com/how-to-write-your-own-native-nodejs-extension/
Can you explain the following in d3?
var nodes = cluster.nodes(packages.root(classes)),
links = packages.imports(nodes);
I can't seem to find the proper information on the packages.root and packages.imports.
I think I know what the code is doing.
This is from the bundle-radial.js in the d3 examples.
The packages object is defined in packages.js, which each of the bundle example html files includes ahead of their respective bundle-X.js.
I was trying to export https://github.com/LiosK/UUID.js into a module, but I'm having a rough time - version 4 is worthless to me (use case Cassandra) - does anybody know of a binding for these types of uuids? I can't seem to find one on Google...maybe someone has implemented what's out there?
Thanks!
I think you can just use /dist/uuid.core.js with a slight modification as follows:
add the following line and save:
exports.UUID = UUID;
now in another file use:
var UUID = require("path/to/the/uuid.core.js");
console.log(UUID.generate());
hope that helps
J
https://github.com/broofa/node-uuid now supports v1 format IDs. FWIW.