Leaflet extension: “this.callInitHooks is not a function”GeoTIFFS on Geoserver are served slowly, at too...

What would be the most expensive material to an intergalactic society?

Can one live in the U.S. and not use a credit card?

Use Mercury as quenching liquid for swords?

Volume of hyperbola revolved about the y -axis

Doublet with ladder line vs coax w.r.t. noise

Having the player face themselves after the mid-game

Are all players supposed to be able to see each others' character sheets?

Insult for someone who "doesn't know anything"

What can I do if someone tampers with my SSH public key?

How exactly does an Ethernet collision happen in the cable, since nodes use different circuits for Tx and Rx?

School performs periodic password audits. Is my password compromised?

How should I solve this integral with changing parameters?

Why restrict private health insurance?

How can a demon take control of a human body during REM sleep?

Is "cogitate" used appropriately in "I cogitate that success relies on hard work"?

What will happen if my luggage gets delayed?

The preposition for the verb (avenge) - avenge sb/sth (on OR from) sb

Computation logic of Partway in TikZ

What is better: yes / no radio, or simple checkbox?

Sampling from Gaussian mixture models, when are the sampled data independent?

Difference between `nmap local-IP-address` and `nmap localhost`

Is divide-by-zero a security vulnerability?

A running toilet that stops itself

Is it a Cyclops number? "Nobody" knows!



Leaflet extension: “this.callInitHooks is not a function”


GeoTIFFS on Geoserver are served slowly, at too low resolutionLeafletJS How to set custom map scale for a flat image map (CRS.Simple)Leaflet markerClusterGroup 'undefined is not a function'Zoom to GeoJSON point feature in leafletLeaflet JS PluginMarkerCluster don't work with geojson layer in leafletChanging the style of a polygon with a click event in a Shiny/Leaflet appLeaflet L.geoJSON.getLatLng() is not a functionSaving leaflet map as image?Leaflet invalidate size - is not a function (undefined)













0















I am trying to develop a leaflet function but I am getting this error which I am having trouble understanding. This is my plugin code thus far:



L.Spotlight = L.Class.extend({

options: {
width: 1,
height: 1
},

initialize: function(name, options) {
this.name = name;
L.setOptions(this, options);
}

});


And this is the code that calls it:



var mySpotlight = L.Spotlight("aaa", {
width: 1,
height: 1
});


I get this error when trying to initialize mySpotlight:



this.callInitHooks is not a function


I'm having a hard time understanding this because it seems like other plugin source code that I look at behaves the same way, for example, this one:



L.Ellipse = L.Path.extend({

options: {
fill: true,
startAngle: 0,
endAngle: 359.9
},

initialize: function (latlng, radii, tilt, options) {

L.setOptions(this, options);
this._latlng = L.latLng(latlng);

if (tilt) {
this._tiltDeg = tilt;
} else {
this._tiltDeg = 0;
}

if (radii) {
this._mRadiusX = radii[0];
this._mRadiusY = radii[1];
}
},

...

});








share



























    0















    I am trying to develop a leaflet function but I am getting this error which I am having trouble understanding. This is my plugin code thus far:



    L.Spotlight = L.Class.extend({

    options: {
    width: 1,
    height: 1
    },

    initialize: function(name, options) {
    this.name = name;
    L.setOptions(this, options);
    }

    });


    And this is the code that calls it:



    var mySpotlight = L.Spotlight("aaa", {
    width: 1,
    height: 1
    });


    I get this error when trying to initialize mySpotlight:



    this.callInitHooks is not a function


    I'm having a hard time understanding this because it seems like other plugin source code that I look at behaves the same way, for example, this one:



    L.Ellipse = L.Path.extend({

    options: {
    fill: true,
    startAngle: 0,
    endAngle: 359.9
    },

    initialize: function (latlng, radii, tilt, options) {

    L.setOptions(this, options);
    this._latlng = L.latLng(latlng);

    if (tilt) {
    this._tiltDeg = tilt;
    } else {
    this._tiltDeg = 0;
    }

    if (radii) {
    this._mRadiusX = radii[0];
    this._mRadiusY = radii[1];
    }
    },

    ...

    });








    share

























      0












      0








      0








      I am trying to develop a leaflet function but I am getting this error which I am having trouble understanding. This is my plugin code thus far:



      L.Spotlight = L.Class.extend({

      options: {
      width: 1,
      height: 1
      },

      initialize: function(name, options) {
      this.name = name;
      L.setOptions(this, options);
      }

      });


      And this is the code that calls it:



      var mySpotlight = L.Spotlight("aaa", {
      width: 1,
      height: 1
      });


      I get this error when trying to initialize mySpotlight:



      this.callInitHooks is not a function


      I'm having a hard time understanding this because it seems like other plugin source code that I look at behaves the same way, for example, this one:



      L.Ellipse = L.Path.extend({

      options: {
      fill: true,
      startAngle: 0,
      endAngle: 359.9
      },

      initialize: function (latlng, radii, tilt, options) {

      L.setOptions(this, options);
      this._latlng = L.latLng(latlng);

      if (tilt) {
      this._tiltDeg = tilt;
      } else {
      this._tiltDeg = 0;
      }

      if (radii) {
      this._mRadiusX = radii[0];
      this._mRadiusY = radii[1];
      }
      },

      ...

      });








      share














      I am trying to develop a leaflet function but I am getting this error which I am having trouble understanding. This is my plugin code thus far:



      L.Spotlight = L.Class.extend({

      options: {
      width: 1,
      height: 1
      },

      initialize: function(name, options) {
      this.name = name;
      L.setOptions(this, options);
      }

      });


      And this is the code that calls it:



      var mySpotlight = L.Spotlight("aaa", {
      width: 1,
      height: 1
      });


      I get this error when trying to initialize mySpotlight:



      this.callInitHooks is not a function


      I'm having a hard time understanding this because it seems like other plugin source code that I look at behaves the same way, for example, this one:



      L.Ellipse = L.Path.extend({

      options: {
      fill: true,
      startAngle: 0,
      endAngle: 359.9
      },

      initialize: function (latlng, radii, tilt, options) {

      L.setOptions(this, options);
      this._latlng = L.latLng(latlng);

      if (tilt) {
      this._tiltDeg = tilt;
      } else {
      this._tiltDeg = 0;
      }

      if (radii) {
      this._mRadiusX = radii[0];
      this._mRadiusY = radii[1];
      }
      },

      ...

      });






      leaflet plugins leaflet-plugins





      share












      share










      share



      share










      asked 9 mins ago









      wfgeowfgeo

      1,356417




      1,356417






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f314946%2fleaflet-extension-this-callinithooks-is-not-a-function%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f314946%2fleaflet-extension-this-callinithooks-is-not-a-function%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          (145452) 2005 RN43 Классификация | Примечания | Ссылки |...

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          Энтрерриос (город) Содержание История | Географическое...