WordPress.org

Ready to get started?Download WordPress

Forums

Leaflet Maps Marker (Google Maps, OpenStreetMap, Bing Maps)
[resolved] Programmatically adding new markers to the layer (6 posts)

  1. Ahaenor
    Member
    Posted 1 year ago #

    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/ 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/

  2. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    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

    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

    best,

    Robert

  3. Ahaenor
    Member
    Posted 12 months ago #

    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!

  4. RobertHarm
    Member
    Plugin Author

    Posted 12 months ago #

    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.

  5. Ahaenor
    Member
    Posted 12 months ago #

    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?

  6. RobertHarm
    Member
    Plugin Author

    Posted 12 months ago #

    please open a new ticket as this might be easier for others to follow & who might have the same question

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.