Okay
  Public Ticket #2450237
leaflet
Closed

Comments

  • olivierfischer started the conversation

    I am trying to  add some custom leaflet code to a map.I get an error mesage 


    ReferenceError: L is not defined


    How do I access L ?


    Thanks,

    Olivier

  •  2,979
    Andrew replied

    Hi Olivier,

    Ensure you set valid latitude and longitude.

    1854399057.png

    Kind regards.

  • olivierfischer replied

    Andrew,

    I already do this.

    I actaully have the map working with Salient markers already. What i want to do is add a second type of markers. I want to do this through JS using leaflet. I can already retrieve the referrence to map oject that Salient instantiates. I am trying to create a new icon using the follwoing statement:

    var greenIcon = L.icon({ myIconURL,

        iconSize:     [38, 95], // size of the icon
        iconAnchor:   [22, 94], 
        popupAnchor:  [-3, -76] 
    });


    That is when i get the error message: ReferenceError: L is not defined


  •  2,979
    Andrew replied

    Hi Olivier,

    It will need a bit of custom modification which is outside the scope of support to be able to second type of markers. The file can be found in wp-content\plugins\salient-core\js\nectar-leaflet-map.js.

    Thanks.