Quantcast
Channel: THWACK: All Content - Network Performance Monitor
Viewing all articles
Browse latest Browse all 21870

Worldwide Map Customizations

$
0
0

I'm customizing the Worldwide map to include features it doesn't currently have, specifically adding leaflet plugins. I know some of these features I want to add are already under development but they won't be released for some time.

I would like to preform all my customizations using a custom HTML resource I place in the page with the world map. I can make all the changes via JavaScript in the HTML resource and then I won't need to modify anything on the server.

The map variable is giving me issues. I cannot reference the map variable within my JavaScript due to scope.

 

How can I access the map variable so I can add my plugins?

Any attempts of mine to use the namespace functions haven't been successful.

 

Here is the map setup code:

$(function(){ // Wait for DOM load

  var vol = SW.Core.namespace('SW.Core.Volatile.WorldMaps');
  var opts = { lat: 40, lng: -90, zoom: 4, resourceid: '----myMapResourceID----', optimize: true, tileset: '' };
  var map = vol[opts.resourceid] = SW.Core.WorldMap.Viewer.Create('worldmap'+opts.resourceid, opts );
  map.Refresh();
  SW.Core.View.AddOnRefresh(function(){ SW.Core.Volatile.WorldMaps[opts.resourceid].Refresh(); });
});


If anyone could point me in the right direction that would be very helpful.



Thanks!


Viewing all articles
Browse latest Browse all 21870

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>