 
   NMIS.loadOpenLayers = (url)->
     url = "#{NMIS.settings.openLayersRoot}OpenLayers.js" if !url and NMIS.settings.openLayersRoot
+    $.ajax url: url, dataType: "script", cache: false
+
+  NMIS.loadLeaflet = (url)->
+    url = "#{NMIS.settings.leafletRoot}leaflet.js" if !url and NMIS.settings.leafletRoot
     $.ajax url: url, dataType: "script", cache: false
 
   NMIS.loadGmapsAndOpenlayers = do ->


  NMIS.settings =
    openLayersRoot: "/static/openlayers/"
    pathToMapIcons: "/static/images"

  NMIS.url_root = do ->

      $elem = $(eselector).css width: 680, height: 476, position: 'absolute'
      launcher = NMIS.loadOpenLayers()
      launcher.done ()->
        OpenLayers._getScriptLocation = ()-> NMIS.settings.openLayersRoot
        $(".map-loading-message").hide()
        elem = $elem.get(0)
        mapId = "nmis-ol-country-map"
