Here API | MultiValueQueryParameter for Via Points - here-api

I'm using the latest version of the here javascript sdk 3.1.32.0
When I use H.service.Url.MultiValueQueryParameter for my via points like
{
...,
via: new H.service.Url.MultiValueQueryParameter(['50.1234,8.7654', '51.2234,9.1123']);
}
I see in the URL params of my request this: &via=%5Bobject%20Object%5D
Someone an idea why this happens?
Thanks in advance!

When you use "via" parameter, you define a list of via waypoints. A via waypoint is not a native datatype recongnized by JavaScript, therefore, you will see in the URL params the word object refering to a particular data structure, in this case the via Waypoint composed mainly by Latitude, Longitude.
Regards.

This took a while to figure out the actual issue with the malformed url params. I was dynamically loading the here maps service script on mount of a component. Accidentally this happened in some cases twice. In both cases H was globally available and everything worked like expected. BUT when the script was loaded twice H.service.Url.MultiValueQueryParameter didn't return the correct params. It basically encoded them twice, or tried to.
The other side issue was that https://www.npmjs.com/package/#types/heremaps is outdated and doesn't cover MultiValueQueryParameter. So I had to remove the types and use my own. Else I probably would have realized the issue earlier.

Related

WP API Ignoring parameters

I have a function that loops through my products and creates some json files. Recently this function stopped working correctly.
I tracked it down to the fact the call to the WP API is ignoring the per_page parameter and always grabbing just the first 10.
$response = wp_remote_get($api_url . '/wp-json/wp/v2/products?per_page=50');
I have tried multiple parameters, like adding an offset, nothing works. It grabs the first 10 and that is it.
Has something changed? I tried Googling and I don't find anything relevant. The API documentation says this should work.
If I just put that url with the request in the browser address bar I get the 50.

Meteor Iron Router does not get Current Path from Route

In a Template Helper I get the current path from Iron.Router (iron:router) as follows:
Router.current().route.path(this);
This works fine, unless the route path does contain parameters (e.g. /client/:_id/edit). In that case the path() function returns null.
How do I get the current path within a Template Helper, when the route contains parameters?
There are posts around covering the issue but the solution mentioned there seem not to fit.
I'm using Meteor 1.1.5 with iron:router1.0.7
According to this iron-router/issues/289 there are problems when the path contains parameters. The suggestion to use Iron.Location.get().path This works well for me.

javascript google map v3 and data property missing

Trying to load a geojson result into my google map. According to the documentation ("Every Map has a Data object by default, so most of the time there is no need to construct one.") I can just do map.data.loadGeoJson. The problem is that there is no data property on map. So I tried to just create on by doing google.maps.Data(). Again Data is not a recognized type. This comes from documentation of version 3.16. Can anybody tell me what I am doing wrong? this is the url I use to reference map:
https://maps.googleapis.com/maps/api/js?libraries=visualization&sensor=false&language=en&v=3.16
It's a property of the google.maps.Map-instance:
var someMapInstance=new google.maps.Map(/*arguments*/);
//someMapInstance.data will be what you are looking for
console.log(someMapInstance.data);
Now it is showing up. I had recently changed my link from version 3.14 to 3.16 so maybe it just got stuck in cache though not sure how since the url was different but either way it is working now.

Open direct links to AX-objects or datasets from external application

Is there a way to open a specified document, eg "production order 123" or form, eg "purchase orders" in Ax2012 from an external application directly?
In detail, I'm looking for something similiar like AXPath, but this doesn't work with versions greater then 2009.
Is there any ( maybe included ) way to achieve this?
There is! It's using AX's drilldown functionality which uses AxHLink.exe to handle dynamics:// URLs, which are passed to the Classes\SysStartupCmd function. You could also create some custom code there if you wanted to launch the AX client executable directly.
My question I asked some while back should have a great deal of useful information in it here:
What handles dynamics:// URLs?
Some more can be found: http://technet.microsoft.com/en-us/library/aa834337.aspx
EDIT:
It sounds like you are confused or the posts weren't clear enough. I think you have 3 basic options.
Dynamics:// URLs are handled by AxHLink.exe and they only seem to handle drilldown, viewalert, and viewalertrule. So if you want to use Dynamics:// URLs, you will need to hi-jack those somehow. There is a pastbin from Jan in that other stack post.
Create a custom URI handler and event poller (lot of work) see http://axcoder.blogspot.dk/2010/10/how-to-open-form-in-running-ax-from.html
Extend SysStartupCmd and then instead of using Dynamics:// URLs, just call Ax32.exe -startupCmd directly and a parameter can be passed to your custom class.

How to add more information to first html page sent by meteor server

Is there anyway we can add data like in php echo "something" in the first html page. I want to know the server's timestamp to format a document created time like 2 hours ago, the document already has a property createdTime. When I use Meteor.Collection.find, I cannot add the server time by using transform.
I can use Meteor.method but I may have to format time before the result arrives.
Thank you.
Well, after digging around the code, here is the answer.
You can use the global variable __meteor_runtime_config__ to add more information to the first downloaded html file. In my case, in a server side javascript file, I add __meteor_runtime_config__.now = new Date().getTime() and this value will be available on the client side
the __meteor_runtime_config__ approach is run-once; that is, only changes made at package load time (not Meteor.startup()) are taken into account, and then the __meteor_runtime_config__ snippet is frozen.
To pass run-time (per-page) metadata to the page, it looks like the only option is to set a custom tag on the <html> element using the (public, but undocumented) WebApp.addHtmlAttributeHook API.

Resources