Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • in reply to: Make Map events accessible #61989
    gheaven
    Participant

    Yes, in your code divs[i].eme_mapObj does have all the same events properties etc. It is the same object pointed to by a different reference. Having said that, I would hesitate in replacing all references to the “div_arr_map[i]” occurrences as you change from referencing a map object directly to referencing a DOM object then a map Object as a new property. Enumerating the list of properties could be time consuming for the browser. If it were accessed only once, no problem. Accessing it 3 or 4 times as you do will accentuate any overhead.

    in reply to: Make Map events accessible #61987
    gheaven
    Participant

    Hi Franky

    The functionality I am looking for is to have a form on a page that also has a locations map (with several locations) that the user chooses one location by clicking on it and the reference to that location is then populated in the form. The default popup is helpful as it shows the user the current focus. The end game for this is that a new event could get created for that location, in our case, a “Grass needs a Mow” event.

    The code of accessing the content of the popup is purely illustrative. The real bit I am after is access to the popupOpen event from leaflet.

    I tried waiting for a general “on click” event from the DIV but leaflet does not pass the event up after opening the popup and shifting focus to it. I have tried playing around with js load sequences to make eme_location_map.js load real early and then grab hold of that array but it is declared privately. Declaring it as public did not work either. So far the only thing that has worked is to add a map object reference to the div and then populate it with a pointer to the leaflet map object that you create in eme-locations-map.

    In answer to your earlier point, I agree that it is possible to find the content of any element of a displayed map by trawling down through the DOM that is written to the DIV by leaflet. My challenge here is knowing that an event has occurred within the map to allow me to go hunting. The only other alternative I can think of would be to hang a polling event off the window and check the map object a couple of times per second. That is really ugly…

    in reply to: Make Map events accessible #61985
    gheaven
    Participant

    Hi Frankie

    So far in my testing on moderately recent browsers it has had no downside. Seems that support for it has been around since about 2010 in some form. The recommendation is to ensure that any new property does not over ride an existing property of the same name so maybe having an eme_ prefix is a sensible idea.

    Also since you (wordpress) totally reloads the page with each major map change event, any attached event handler is cleaned up by the browser’s garbage collection and the map DIV’s all get new ID’s. I think it is fairly safe for now.

    in reply to: Plugin not properly initialising #61251
    gheaven
    Participant

    Hi Franky

    It took me about an hour to download unpack and test. The most recent timestamp (on eme-events.php) is 25-05-2020 10:27pm. Happy to retest. Also as a head up, I am working on locations and maps and I have a growing number of questions. These are important but low priority as the core works well enough for what I want to do at present.

    Gary.

    in reply to: Plugin not properly initialising #61249
    gheaven
    Participant

    Hi Franky
    That Dev version looks like it has done the trick.
    Gary.

    in reply to: Plugin not properly initialising #61240
    gheaven
    Participant
    // GH Added Code Needs to run after Multiple Domains is loaded....
    function eme_events_manager_init() {
    	define('EME_PLUGIN_URL', plugins_url('',plugin_basename(__FILE__)).'/'); //PLUGIN URL
    	define('EME_PLUGIN_DIR', ABSPATH.PLUGINDIR.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)).'/'); //PLUGIN DIRECTORY
    }
    add_action( 'plugins_loaded', 'eme_events_manager_init', 20 );
    // End GH Added Code
    gheaven
    Participant

    Hi Frankie

    Just confirming there is no issue with duplicate names. The ‘require a wordpress user to be logged in’ is a good idea as it prevents duplicates appearing in the people list that can occur otherwise. Keep up the good work.

    gheaven
    Participant

    Hi Frankie

    Your fix seems to be the go but has highlighted another issue with not logged in people that could over write details of other people with the same name. Close this for now and I will do a bit more testing and raise a new issue if it is an issue.

    Ditto on buddypress but keen to work out what is going on. I have been a professional developer on corporate systems since a long long time ago so not afraid of getting in there up to my armpits.

    gheaven
    Participant

    Yes. This is in my dev environment and there are only a few users and I have played around with the linking to the wp_user and not. I have also checked the databaase and the wp_id column is unique except for the zeros. I have been hesitant in creating this request as I can see you are very busy and doing a good job on it. As some background, My plans are to replicate the address and some other fields into Buddypress and do a bit of php magic so they synchronise with eme. I think that ‘people’ ideally should be outside eme and your approach of linking wp users is good. The rationale for me to even try this is so that we have a soft entry for people who then “upgrade” themselves to become full members. For this second step we need addresses and phone numbers as a couple of ways of contacting them.

Viewing 9 posts - 1 through 9 (of 9 total)