Title: Programmatically adding new markers to the layer
Last modified: August 21, 2016

---

# Programmatically adding new markers to the layer

 *  Resolved [Ahaenor](https://wordpress.org/support/users/ahaenor/)
 * (@ahaenor)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/programmatically-adding-new-markers-to-the-layer/)
 * Hello!
 * I’d wish to add several markers to the single layer automatically, i.e. with 
   script. I’ve read API docs here: [http://www.mapsmarker.com/mapsmarker-api/](http://www.mapsmarker.com/mapsmarker-api/)
   and it seems to be what i need: i can just send requests to the plugin script
   to manipulate markers in DB.
 * But i can’t see a “layer” parameter in the list of marker request args. Is it
   possible to do it?
 * Thank you in advance.
 * [http://wordpress.org/plugins/leaflet-maps-marker/](http://wordpress.org/plugins/leaflet-maps-marker/)

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

 *  Plugin Author [Robert Seyfriedsberger](https://wordpress.org/support/users/harmr/)
 * (@harmr)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/programmatically-adding-new-markers-to-the-layer/#post-3960756)
 * Hi,
 * thanks for pointing this out – the API docs were incomplete – just updated them.
 * you first have to create a layer map which afterwards you can assign markers 
   to.
 * Adding a layer:
    [http://your-domain/wp-content/plugins/leaflet-maps-marker/leaflet-api.php?key=YOUR_KEY&action=add&type=layer&name=Store&lat=48.3434&lon=16.43234](http://your-domain/wp-content/plugins/leaflet-maps-marker/leaflet-api.php?key=YOUR_KEY&action=add&type=layer&name=Store&lat=48.3434&lon=16.43234)
 * This newly created layer gets an ID (let´s say it is 1 in our example) – this
   has to be used in the request to add new markers to it:
 * [http://your-domain/wp-content/plugins/leaflet-maps-marker/leaflet-api.php?key=YOUR_KEY&action=add&type=marker&layer=1&lat=48.233&lon=34894](http://your-domain/wp-content/plugins/leaflet-maps-marker/leaflet-api.php?key=YOUR_KEY&action=add&type=marker&layer=1&lat=48.233&lon=34894)
 * best,
 * Robert
 *  Thread Starter [Ahaenor](https://wordpress.org/support/users/ahaenor/)
 * (@ahaenor)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/programmatically-adding-new-markers-to-the-layer/#post-3960924)
 * Hello!
 * Ok, thank you very much. I’ve tested the map with over 2000 markers (clustering
   used, of course). The results are very well – the map page lags out due loading,
   but insignificant, almost seamless at all.
 * We’ll thankfully use the plugin for our needs. Also we’d be glad to see a server
   clustering function, if it’d be added someday – sometimes our projects has even
   more markers.
 * Thanks again!
 *  Plugin Author [Robert Seyfriedsberger](https://wordpress.org/support/users/harmr/)
 * (@harmr)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/programmatically-adding-new-markers-to-the-layer/#post-3960925)
 * you’re welcome – glad to hear that my plugin fits your need. BTW: will release
   pro v1.1 later this week with integrated leaflet.js v0.6.5 and updated marker
   clustering code.
 *  Thread Starter [Ahaenor](https://wordpress.org/support/users/ahaenor/)
 * (@ahaenor)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/programmatically-adding-new-markers-to-the-layer/#post-3960926)
 * Ok, that’s cool. We’ll upgrade.
 * I have another question about base layers available. Can i ask it here, or it’d
   better to create a different topic?
 *  Plugin Author [Robert Seyfriedsberger](https://wordpress.org/support/users/harmr/)
 * (@harmr)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/programmatically-adding-new-markers-to-the-layer/#post-3960928)
 * please open a new ticket as this might be easier for others to follow & who might
   have the same question

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

The topic ‘Programmatically adding new markers to the layer’ is closed to new replies.

 * ![](https://ps.w.org/leaflet-maps-marker/assets/icon.svg?rev=970936)
 * [Leaflet Maps Marker (Google Maps, OpenStreetMap, Bing Maps)](https://wordpress.org/plugins/leaflet-maps-marker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/leaflet-maps-marker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/leaflet-maps-marker/)
 * [Active Topics](https://wordpress.org/support/plugin/leaflet-maps-marker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/leaflet-maps-marker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/leaflet-maps-marker/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Robert Seyfriedsberger](https://wordpress.org/support/users/harmr/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/programmatically-adding-new-markers-to-the-layer/#post-3960928)
 * Status: resolved