Embedding NUKEMAP

NUKEMAP from version 2.4 onward can be embedded into any webpage very easily, and customized for your purpose. This page demonstrates this and outlines some of the options available to you.

NOTE: If your embedding of the NUKEMAP in any way introduces security problems, bandwidth problems, or any other problems for the NUKEMAP, your ability to embed the NUKEMAP or some of its individual components (e.g. the casualty estimates) may be revoked. The most computationally-intensive part of the NUKEMAP is the casualty estimator so if you can avoid linking to it with casualties turned on, that would help a lot.

NOTE: The ability to embed the NUKEMAP does not imply that you have been given any ownership or control over the NUKEMAP. All copyrights are retained. It also cannot be used to imply that I (Alex Wellerstein), any institutions I am associated with, or the NUKEMAP website itself is endorsing or collaborating with you in any way. Your use of the NUKEMAP on your site represents a non-transferable, revokable license issued by Alex Wellerstein.

NOTE: By default, embedded windows will not immediately load the map interface without input from the user (clicking on it). This is because loading the full map interface is intensive for the website and the browser and I want to make sure it only happens when someone wants to see it. Using the embedlive tag as described below can disable this behavior, but please consider whether it is absolutely necessary to do so.

IFRAME embedding

The NUKEMAP should be linked via an HTML <iframe> tag. Basic iframe syntax looks like this:

https://nuclearsecrecy.com/nukemap/?&kt=20&lat=40.72422&lng=-73.9961&hob_opt=2&hob_psi=5&hob_ft=100&zm=13&lite=city,yield_preset,b_other,b_note,permalink,faq,nm3d,options,classic,footer,social,otheroptions,small
  <iframe src="https://nuclearsecrecy.com/nukemap/" width="800" height="400">
    If you can read this text, your browser does not support iframes. Sorry.
  </iframe>

Which in your browser would produce this as a result:

That doesn't look too bad (assuming your browser supports it), but as you can appreciate, that isn't much better, in and of itself, than just linking to the website directly.

Fortunately, there are a number of things you can do to customize how the NUKEMAP will appear in the iframe. This customization comes through modifying the src (source) property of the iframe tag.

Permalink embedding

The easiest and most obvious modification is to link to specific detonation settings. NUKEMAP is already enabled to produce URLs with links to whatever settings are currently displayed. These are known as permalinks, and they come in two forms. For single detonations, the URL contain easily modifiable properties, e.g.:

  https://nuclearsecrecy.com/nukemap/?&kt=20&lat=40.72422&lng=-73.9961&hob_opt=2&hob_psi=5&hob_ft=100&zm=13

Where the parameters are as follows:

Basic information:

Height of burst:
Fallout:
Other options
Embedding appearance:

Note that all of these properties are browser-based except casualties which is a server-side calculation. So when I note it is computationally intensive, I mean it is computationally intensive for the NUKEMAP server, not the user's computer.

For multiple detonations, these settings are stored on the server and a reference hash is created. These cannot be edited on the fly. They look like this:

  https://nuclearsecrecy.com/nukemap/?t=d7638b279957ef91eade5ab570ec29b9

These are generated by clicking "Generate permalink" and then clicking "Permalink" again. There is currently no way to automate multiple permalink production (maybe someday, if there is interest; it requires using JSON to send a "detonation object" to the server and setting that up for external use would take a little bit of work and explanation).

Using either of these kinds of links as the src property of the iframe tag results in something like these:

  <iframe src="https://nuclearsecrecy.com/nukemap/?&kt=20&lat=40.72422&lng=-73.9961&hob_opt=2&hob_psi=5&hob_ft=100&zm=13" width="800" height="400">
    If you can read this text, your browser does not support iframes. Sorry.
  </iframe>
  <iframe src="https://nuclearsecrecy.com/nukemap/?t=d7638b279957ef91eade5ab570ec29b9" width="800" height="400">
    If you can read this text, your browser does not support iframes. Sorry.
  </iframe>

You will note in the last one that our last example, the zoom is a bit too close for the iframe. To fix this, we can load the detonations from the hash, zoom out a bit more, and then create a new hash:

Generating and loading hashed values is very quick (not computationally difficult) so please feel free to experiment with creating multiple detonations.

Styling the NUKEMAP

As you've no doubt noticed, the NUKEMAP menu is a bit much for such purposes. There are ways to remove or minimize the options available to the user. These are added on manually to the src URLs above with the property of lite. Here's a very stylized version of one of the maps from above:

Notice that the menu on the right has had all of its options removed except for the legend, and has had its size reduced. For certain purposes, this might be much better. So might this sort of display, where the description is completely hidden by default:

Note that clicking on either the words "NUKEMAP" or the small icon at the bottom right restores the menu.

And for others, you might just want to simplify the options available:

In the above, we have disabled all options except for the choice of yield and the detonation button.

A few small things to note: you can never hide the word NUKEMAP (it has to be somewhere), you can never remove the "Created by" section, and whenever you use the function it will insert a small item in the menu explaining that the application has been modified and linking back to the original. You must accept these limitations and not try to work around them or your access will be blocked.

OK, here's how it is done. In addition to a regular permalink URL above, we can add the aforementioned lite parameter. It can simply be appended to the URL like so:

    https://nuclearsecrecy.com/nukemap/?&kt=20&lat=40.72422&lng=-73.9961&zm=13&lite=minify,city,yield

The lite commands can be appended with commas as shown above. The list of working commands follows:

So to replicate the example above where only the yield (but no drop-down list), detonate button, and legend are shown with a small menu, the lite property looks like this:

  lite=city,yield_preset,b_other,b_note,permalink,faq,nm3d,options,classic,footer,social,otheroptions,advoptions,small,createdby

So, in order, it is disabling the city section, the yield preset drop-down list, all buttons except "detonate," the note about dragging the marker, the permalink section, the FAQ link, the NUKEMAP3D link, the basic options section, the classic note, the footer, the social network links, the "other" options, the advanced options, and the "small" tag shrinks everything a bit. Phew!

You can add the lite tag to any URL, it doesn't have to be embedded, so you can play around with it and find the settings that work best for your purposes. (Here is the URL embedded above.) Note that the lite property is not preserved with new permalink creations, so you will have to copy the lite settings if you are going to change the blast parameters. You can also add the lite tag to hashed URLs.

All of the lite hiding/removals/transformations/etc. are applied while the page is still loading. So you can often see the changes being done in real-time. The way the code works now, there's no way around that.