Google Maps heatmap - Custom widget
Download: Google Maps Heatmap
We can create google maps heat map using the plugin api.
1. Extract the folder in the attached zip file into \...\Sisense\PrismWeb\plugins.
if plugins folder does not exist, create it. If you are using version 7.2 and higher unzip the contents into your C:\Program Files\Sisense\app\plugins\ folder.
2.create new widget and add latitude, longtitude and measure columns.
it must be in this order, where lat and lng are the first two columns and last one is the measure, it is possible to add more dimension columns between them, the additional dimensions will be presented in the tooltip of the markers, but the calculations will be executed according to the measure in the last column.
3. press the google maps icon.
Notes:
The code attached using experimental google maps api key, it has limited number of requests allowed per day, more information can be found here.
$.ajax({
type : "GET",
url : 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=onGoogleMapLoaded',
dataType : "script",
cache : true
});
- The plugin.json file is used to get all the necessary files that we need for the plugin
- the widget.js implement the necessary methods to render the map
- the css file is used to design the tooltip of the marker clusters
Important:
When SSL (HTTPS) is implemented over your Sisense site, you will need to change the following URLs in widget.js from http to https:
$.getScript('https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/src/markerclusterer.js';, function (data, textStatus) {
$.getScript('https://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js';, function (data, textStatus) {
Update: Fixed a bug which prevented users from adding multiple maps widgets to a single dashboard
Update 12/07/2015: Fixed Google URL for icons. Added auto switch between HTTP and HTTPS (no need to change url inside js script)
Update 17/05/2016: Updated paths to Google scripts and minor fixes
-
I tried to implement this but have been running into the issue where the sometimes google map elements are not getting loaded properly. Please see the image (1) and image (2) comparison.
Thank you
image (2).png
image (1).png -
Does this have anything to do with the script in https://maps.gstatic.com/maps-api-v3/api/js/17/15/main.js ?
main_js.png -
You can modify the starting view in this widget by editing the widget.js script in the attached zip folder.
On line 174, you define the variable myLatlng, which you can change to whichever latitude and longitude you'd would like the map to center on.
On line 176, you can adjust the zoom variable to specify how much to zoom in on initialization.
-
Want to show more details in each marker's popup? Check out the updated plugin! You can set the color the markers based on a field, and add as many details fields as you like. All the detail fields show up within the popups of each marker.
googleMapsWidget.zip -
Hi Erik,
As in any other widget, the value is an aggregated measure per each location.
If you have a specific value per location you can select to use Max, Min or Average to show non-Total values.
I hope this makes sense. If you have further questions, please feel free to contact us by submitting a support request.
-
Hi Arik,
I Think that what Erik meant is, can the number of pins (which is what currently those Heat Circles show; the number shown directly on Map not when you hover over that Circle) be replaced by accumulated value of pins behind given Heat Circle(which is currently shown when you hover over a Circle).
-
I'm trying to get this working with SSL and the map itself is not showing. I did edit the widget.js and modified these addresses:
https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=onGoogleMapLoaded
https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/src/markerclusterer.js
https://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js
https://jawj.github.io/OverlappingMarkerSpiderfier/bin/oms.min.js
I originally changed these two, but changed them back when I noticed certifcate errors:
http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|
http://chart.apis.google.com/chart?chst=d_map_pin_shadowHas anyone got this working with SSL?
-
Hi Claire,
To check version of SiSense log in the web browser and on home page at the bottom right corner you have the verison number of SiSense. As for the numbers, the number you see directly on map in each circle shows how many pins are under given circle. You're right that this is completely unrelated to your data.
Regards,
Michał
-
Really love this plugin. Wondering though if theres a way to get it to do what i need. I want to distinguish my main site from the surrounding sites so we can see where the main site is in relation to all the nearby sites around it and maybe have miles/km radius around the main site.
any ideas?
thanks,
mark
-
Seems like this is broken now with the shutdown of google code. We tried moving the code locally for infobox.js,markerclustererplus.js and also all the marker images from https://github.com/googlemaps/v3-utility-library but we still have issues with no map images showing up.
Any ideas on what is breaking this up as no errors seem to show up on browser ocnsole?
-
There is no way I'm familiar with of using this JSON within Google maps plugin.
What I suggest is to get the Longitude latitude using this Site and adding the results as a table to the cube.
-
Hello,
Google has changed the use of google maps. As far as I understood this kind of free version which is used in this plugin will not work anymore. The Map is shown only with a watermark "only for development".
How can I implement my API Key into the script to keep it running?
Could please someone give me assistance?
Thank you very much
Antti
-
Hello,
Google has changed the use of google maps. As far as I understood this kind of free version which is used in this plugin will not work anymore. The Map is shown only with a watermark "only for development".
How can I implement my API Key into the script to keep it running? and where do I retrieve my API key?
Could please someone give me assistance?
Thank you very much
Please sign in to leave a comment.
Comments
31 comments