WordPress.org

Ready to get started?Download WordPress

Forums

Leaflet Maps Marker (Google Maps, OpenStreetMap, Bing Maps)
[resolved] collision with my plugin - Con (15 posts)

  1. shemesh
    Member
    Posted 1 year ago #

    hi, i've written a map plugin for cf7 - Contact Form 7 Map Field, i too use there the Leaflet library to show a map.
    when i have both plugins active there seems to be some collision in code causing the marker icon on my map to disapear!
    inspecting the code of my plugin's map i see the marker icon url is: http://localhost/wordpress/wp-content/plugins/leaflet-maps-marker/leaflet-dist/images/marker-icon.png
    this png does not exist of course.
    the correct url of the png should be: http://cdn.leafletjs.com/leaflet-0.4.4/images/marker-icon.png

    when i DEactivate maps-marker i get the correct url and image.

    any idea why does the maps-marker plugin changing this url?

    p.s i've fixed this in cf7-map plugin v1.4 by giving the marker a new icon with an explicit url, but this is not a best practice. it can be tested with v1.3.

    why does it happen?

    http://wordpress.org/extend/plugins/leaflet-maps-marker/

  2. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    thanks for letting me know about this. I took a look into your plugin. As we are both adding leaflet.js to <head>, I fear that our plugins just cannot be used together without problems :-(. I use an adapted leaflet.js to support localization and also added Google Maps and Bing Maps code to leaflet.js

    ad marker icon url: I intenionaly use /leaflet-dist/images/marker-icon.png for the default marker - I try not to rely on external libraries and images.
    Anyway: I created a default form with your map here: http://beta.mapsmarker.com/?p=145 - display of the marker seems to be ok for me - only my map is broken...
    regards,

    Robert

  3. shemesh
    Member
    Posted 1 year ago #

    Robert hi,
    few questions:
    1) how do you change the path of the icon?
    2) why does your change affect mine?
    3) in the sample form you've made there seems to be something wrong - where is "my" map?

    tnx.

  4. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    See the example page again please - I reactivated your plugin.
    I dont change your path - I use a unique constant for icon path directory in my plugin - so it shouldnt affect yours (which you can see from the example page...)
    regards
    Robert

  5. shemesh
    Member
    Posted 1 year ago #

    ok, now the form looks good :-)
    it looks good because you are using the latest version of my plugin, there i set the full icon url explicitly in the code to point to: http://cdn.leafletjs.com/leaflet-0.4.4/images/marker-icon.png

    i can live with that.

    bare in mind that the collision still exist and could cause issues with other plugins as well. i can easily show you how to recreate the issue if you would like to see it.

    tnx
    Ofir.

  6. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    I believe you can live with this - it is my maps that are broken because your leaflet.js is getting load after mine and overwritting mine ;-)
    Unfortunately I dont see how we can solve this incompabibility so I added your plugin to my integrated plugin incompativbility check which gives users who have both our plugins active an admin warning notice. Well - one idea justncame into my mind: if you could check if my plugin is active and not load leaflet.js in this case, both of our plugins might work. I could help you with the code for this if that would be a solution for you.
    Regards,
    Robert

  7. shemesh
    Member
    Posted 1 year ago #

    hi,
    back to that issue...

    I'm using latest versions of both plugins and do NOT see anything broken, seems like everything is working great on both maps.
    can you verify this?

  8. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    I made a test post at http://beta.mapsmarker.com/?p=169 with 1 marker and 1 layer map and a cf7-form with map field. Seems to work now. Did you release a new version which fixes the incompatibility we verified earlier? If yes, I will remove your plugin from my incompatibility check of course...
    regards,
    Robert

  9. shemesh
    Member
    Posted 1 year ago #

    yes, i got a new version.
    not sure what the collision was but it works now.

  10. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    just removed the incompatibility check for your plugin from the current v2.9.
    regards,
    Robert

  11. shemesh
    Member
    Posted 1 year ago #

    good news. tnx.

  12. slimkaos
    Member
    Posted 1 year ago #

    Hi Robert, you dont happen to have any info on how you changed shemesh's plugin over to google maps do you?

    I am trying to build a wordpress site which can take a customers postcode, find their house on the satellite image on google maps and let them set a marker on it.

    they will then fill in the rest of their contact details and it will be sent in an email to me.

    Shemeshs Contact Form 7 Map Field plug in does everything i need except the satellite map from google maps.

    Do you guys have any thoughts on how best to accomplish this?

  13. slimkaos
    Member
    Posted 1 year ago #

    http://www.pv.co.uk/

    This is the sort of site i am looking to put together although without the coda slider

  14. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    I am using the leaflet google maps plugin from shramov on github.
    allowing guests to add markers with my plugin is planned for the pro version...

  15. shemesh
    Member
    Posted 1 year ago #

    slimkaos hi,
    ask this question on my plugin page, i'll try to help you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic