Title: Access to leaflet map variable
Last modified: February 23, 2023

---

# Access to leaflet map variable

 *  Resolved [MartinW2](https://wordpress.org/support/users/martinw2/)
 * (@martinw2)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/access-to-leaflet-map-variable/)
 * How can I access/modify a map created by the plugin with own leaflet javascript
   code? Is there a way to get access to the corresponding map object without modifying
   the plugin?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [hupe13](https://wordpress.org/support/users/hupe13/)
 * (@hupe13)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/access-to-leaflet-map-variable/#post-16500502)
 * Bozdoz answers this question in the [FAQ](https://github.com/bozdoz/wp-plugin-leaflet-map#how-can-i-add-another-leaflet-plugin).
   
   Or see the code of [Extensions for Leaflet Map](https://github.com/hupe13/extensions-leaflet-map-github)
   in the php directory. Examples are on this [page](https://leafext.de/extra/category/forum/)
   also:
    - How to include Leaflet plugin leaflet-geosearch
    - Nautic Scale
    - How to set maxBounds conditionally
 *  -  This reply was modified 3 years, 3 months ago by [hupe13](https://wordpress.org/support/users/hupe13/).
 *  Thread Starter [MartinW2](https://wordpress.org/support/users/martinw2/)
 * (@martinw2)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/access-to-leaflet-map-variable/#post-16500557)
 * Shame on me…. 🙁
   I found this in FAQ (as mentioned above by hupe13) …
 *     ```wp-block-code
       // iterate any of these arrays: maps, markers, lines, circles, geojsons
       var maps = window.WPLeafletMapPlugin.maps;
       ```
   
 * … which should be all I need to continue.
   Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Access to leaflet map variable’ is closed to new replies.

 * ![](https://ps.w.org/leaflet-map/assets/icon-256x256.png?rev=1693083)
 * [Leaflet Map](https://wordpress.org/plugins/leaflet-map/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/leaflet-map/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/leaflet-map/)
 * [Active Topics](https://wordpress.org/support/plugin/leaflet-map/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/leaflet-map/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/leaflet-map/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [MartinW2](https://wordpress.org/support/users/martinw2/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/access-to-leaflet-map-variable/#post-16500557)
 * Status: resolved