How to get a fixed projection on Geo Map view on live dashboard?

Comments

1 comment

  • Avatar
    Piotr Woch

    Hello Fun Studio!

    Unfortunately, the Map Charts don't allow for any fixed parametrisation/customisation. The view-frame cannot be pre-set and the colors of the datapoints cannot be customised.

    However, I did come up with a workaround that I am hoping you might find useful.

    Below is the search expression that works as follows: it creates two "anchor" data points of value 1 that show up in two opposite remote stretches of the world and effectively fix the view to the entire world regardless where the actual data points show up.

    I tested with data points from HK, GB and US, and each time the map was showing up on my test dashboard pretty stably covering the globe:



    The obvious downside is that these "random" datapoints show up and might require some legend/commentary not to confuse the dashboard users.

    In case you find this solution acceptable, below is the search I created. It should be usable on plug&play basis, except for the parts I marked in bold. The location of the anchors can be tweaked by modifying the "-75" and "75" values, the rule of thumb is that they should be further-out on the map than the real data points.

    _collector="Apache"
    | where !isNull(src_ip)
    | lookup latitude, longitude, country_code from geo://default on ip=src_ip
    | where country_code = "HK"
    | "|||" as dup_rows
    | parse regex field=dup_rows "(?<duped>:|)" multi
    | 1 as row_num
    | accum row_num as row_count
    | IEEEremainder(row_count,3) as remainder
    | if(remainder = 1, -75, if(remainder = -1, 75, latitude)) as latitude
    | if(remainder = 1, -75, if(remainder = -1, 75, longitude)) as longitude
    | where remainder = 0 or row_count < 4
    | count by latitude, longitude

    Best regards,

    Piotr Woch

    0
    Comment actions Permalink

Please sign in to leave a comment.