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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...