mapster
mapster copied to clipboard
MultipleTargets not working
Based on the tooltip info for location data
I entered the data as
{"location1": [lat1, lon1], "location2": [lat2, lon2]}
But the console keeps showing the error
TypeError: Cannot read property 'lat' of undefined
at kibana.bundle.js?v=10229:82769
at commons.bundle.js?v=10229:45562
at completeOutstandingRequest (commons.bundle.js?v=10229:33214)
at commons.bundle.js?v=10229:33491
Which is essentially this line
if (config.multipleTargets) {
var targetCoords = getCoords([event.target.lat, event.target.lon]);
Any ideas? :(
I'm a bit busy now I'll give a look this week end
Sorry, I've been busy those days, I did not have the time to check, neither to install a running version of Kibana on my laptop. I don't remember how I did implement it, but I think the help message is wrong. According to those lines:
var targetAggId;
try {
targetAggId = vis.aggs.bySchemaName['target'][0].id;
} catch (err) {
console.log("Target location is not set.");
}
[...]
var id = table.columns[i].aggConfig.id;
switch (id) {
[...[
case targetAggId:
targetColumn = i;
break;
}
[...]
if (targetColumn >= 0) {
data['target'] = geohash.decode(row[targetColumn].key);
}
This refers to the aggregation named target
which means that you need one GeoHash for the event origin coordinates, and another GeoHash for the targeted coordinates.
So yes the help message is wrong, I should fix it, but to be clear, if you uncheck the multipleTargets
box, then it looks for the GeoHash field you set in the target
aggregate.
I hope it's more clear, since I did not test it let me know if anything is wrong.
@xarkes when you say "So yes the help message is wrong" you are referring to "Multiple targets" help box:
If the attacks should point to different targets, then select this. If you uncheck it, then the targets will point to the same unique location. Values true: use multiple directions false: use only one direction
yes? If so, to be clear, you are saying the option is inverted? i.e. to use multiple locations uncheck the "Multiple targets" box, not check it?
In doing so I have encountered the following errors:
Error:
atribute d: Expected number, "….09007377295427LNaN,NaN".
Uncaught TypeError: Cannot read property 'removeChild' of null at destroyPurpleBox (purplebox.js:36) at purplebox.js:51
The console also notes that "Target location is not set".
Unfortunately I am unable to test it right now and give you a proper solution. I think the correct way is to add the aggregation named "Target location" (target) and to check the box "Multiple targets" and just ignore the one named "Target coordinates" (keep the default value). So this requires each of your event to have an origin geohash and a destination geohash. Try with this and let me know
Please Xarkes, i have multiple traget location in a geo_point location, can you explain me how to use it. I'can see multi direction lines in the world map.
Many Thanks
As I said in my previous message, try to use one geohash for the "Coordinates" aggregate and another one for "Target location" aggregate. Then check the box "Multiple targets" in the parameters. This should work fine.