All Apps and Add-ons

Google Map in Web Framework adding Markerclusterer

efullman
Path Finder

I'm trying to move some applications to the Web Framework from Advanced XML including a Twitter Listening app that would use the GoogleMapView instead of the Google Map App with Advanced XML.

The new GoogleMapView doesn't seem to have implemented MarkerClusterer as in the Google API Splunk App, and isn't well documented enough to understand how the "map" field can be used to implement layers and functions like MarkerCusterer.

I have too many points to plot to not have clustering. Without this functionality the new GoogleMapView seems partially implemented, only a relatively small number of points can be plotted. The Maps aren't very reusable.

The challenge is how to implement the hook to the map field. I've got the GoogleMapView plotting the map, but it ignores the MarkerClusterer command. I'm using the MarkerClustererPlus code found here: (website: google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/docs/reference.html )

I'm not seeing any errors in the console. I've tried multiple combinations with .render(); on the MarkerClusterer, putting outside the require (deps, etc. The challenge is that all the code examples that are provided are really simple.

Has anyone tried to repurpose the Google Map App for the web framework? Or does anyone have some code examples I can use?

Ultimately I would love to implement Heatmap.js (website: patrick-wied.at/static/heatmapjs/example-heatmap-googlemaps.html) as a layer, as an alternative to the MarkerClusterer.

I have this app already running under Advanced XML with the Google Map App. It's frustrating that we can't use the GoogleMapView as easily.

Your help is really appreciated.


{% block js %}

<script src="{{STATIC_URL}}{{app_name}}/markerclustererpl.js" type="text/javascript">
</script>
<script>
    var deps = [
        "splunkjs/ready!",
        "splunkjs/mvc/googlemapview"  
    ];
    require(deps, function(mvc) {
        var GoogleMapView = require("splunkjs/mvc/googlemapview");

        // Create Googlemap
           tweetmap = new GoogleMapView({
            id: "Tweetgooglemap",
            managerid: "Tweet-search",
            scrollwheel: false,
            center: ({lat:39.10190, lng:-84.50970}),
            mapTypeId: "roadmap",
            zoom: 4,
            mapTypeControl: false,
            el: $("#tweetview")
        }).render();
      var mc = new MarkerClusterer(tweetmap);       
      });


</script>
{% endblock js %}
0 Karma

igorlazarev
Engager

if you are find a solution please post

0 Karma

efullman
Path Finder

Spending more time with this problem, I was able to partially solve my need for MarkerClusterer by using the SplunkMapView versus the GoogleMapView. SplunkMapView implements OpenStreetMap. The functionality of the Leaflet MarketClusterer is partially deployed. A lot of the animation available in Leaflet isn't deployed in the Splunk-Mapping.js file.

0 Karma

efullman
Path Finder

I was looking through the Splunk mapping code at splunk_mapping.js, and I noticed that Leaflet makerclusterer has been implemented. Can someone from Splunk provide any code examples of invoking this information, or the code on implementing layers like heatmap.js.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...