Building a custom interactive map plugin – looking for feedback

  • Unknown's avatar

    I recently worked on a project that required a fairly advanced interactive map inside WordPress. The requirements included polygon areas, category filters, custom markers, and clickable info panels.

    I initially tried several existing map plugins, but I kept running into limitations — especially when it came to data flexibility and full control over the map styling. Most solutions worked well for basic use cases, but this project needed something more customizable.

    So I decided to build a small custom plugin from scratch.

    The approach I ended up using:

    • Store locations as Custom Post Types + taxonomies
    • Use Leaflet Draw in the admin area to create polygon regions
    • Use MapLibre on the frontend to fully control the map style (vector tiles)

    It worked surprisingly well, and I documented the full process step-by-step here:
    https://apriyanto.my.id/blog/build-interactive-map-plugin-wordpress/

    I’m sharing this mainly to get feedback from other WordPress developers here.
    Do you think building custom plugins is the right approach for cases like this, or would you still try to adapt existing plugins first?

    Would love to hear your thoughts and experiences 🙂

  • Unknown's avatar

    Hey @apriyanto99

    This is a really solid approach honestly, and I think you made the right call building custom for this one.

    The moment a project needs polygon regions + custom styling + flexible data structures, most existing map plugins start feeling like you’re fighting them more than using them. MapLibre for frontend control and CPTs + taxonomies for data storage is a clean, scalable architecture, that’s exactly how I’d approach it too.

    The one thing I’d add from experience: caching the GeoJSON output if your location dataset grows large. MapLibre handles rendering beautifully but if you’re querying CPTs on every map load with hundreds of locations it can get sluggish. A transient cache or a static JSON file updated on post save goes a long way.

    To answer your question directly, I think custom is the right call when:

    • You need full control over map styling (vector tiles especially)
    • Your data model doesn’t fit neatly into what plugins assume
    • Long-term maintainability matters more than quick setup

    Existing plugins are great for “show me these 10 locations with default markers”, once you go beyond that you’re usually better off owning the code like you did.

    Checked out your writeup, nice documentation, really clear step by step. Good share for the community!

Log in or create an account to reply