WordPress.org

Ready to get started?Download WordPress

Forums

Basic Google Maps Placemarks
Filter Placemarks Revisited (80 posts)

  1. mpa4hu
    Member
    Posted 1 year ago #

    That's how my source code looks like
    http://pastebin.com/C98SrsgC
    first is jquerys (in header)

    than there is functions.js

    and in the end your gmapscustomfunctions.js

    ___

    waiting with pleasure (or something like this)

  2. jesse.t
    Member
    Posted 1 year ago #

    http://www.4shared.com/archive/oIyqAUv0/forked.html?

    Install a fresh 1.9.2RC and try to follow the instructions in this file. Let me know what happens.

  3. jesse.t
    Member
    Posted 1 year ago #

    I really need to merge this with 1.9.3...

  4. Ian Dunn
    Member
    Plugin Author

    Posted 1 year ago #

    Hey Jesse, you may want to try merging to trunk instead, since there've been some more changes since 1.9.3-rc2. I don't think it'll affect your work, but there's always the potential.

    I'm running trunk on a couple client's sites and I think it's fairly stable; just haven't had time to finish up testing and release a new RC.

    I think it's to the point where everything is accessible from outside the plugin, so you shouldn't need to modify functions.js directly anymore, but let me know if there's any hooks or anything that would help avoid that.

  5. mpa4hu
    Member
    Posted 1 year ago #

    I tried everything with your code

    Did everything step by step.

    In my console I have error:
    Uncaught TypeError: Cannot read property 'geocoder' of undefined test.js:1
    (anonymous function)

  6. mpa4hu
    Member
    Posted 1 year ago #

    first there comes jquery from functions.php (more in header)
    then functions.js (more in footer, after admin-bar.min.js)
    and last (after adminbar) test.js

    the strange thing I found is <script type='text/javascript' src='http://heureka.ge/wp-content/plugins/basic-google-maps-placemarks/functions.js?ver=1.9.3-rc1'></script>

    In plugins page it says I'm using 1.9.2.
    I there a change this may cause such error?

  7. mpa4hu
    Member
    Posted 1 year ago #

    I hope one day Ian Dunn and Jesse.t could sit down and build one version as in google many users are searching for a such solution.

  8. mpa4hu
    Member
    Posted 1 year ago #

    http://s59.radikal.ru/i166/1302/75/1268495c4dd6.jpg

    I installed your plugin again on fresh WP
    now I have marker error. I created markers and categories for them

  9. jesse.t
    Member
    Posted 1 year ago #

    I apologize for not getting back to this sooner. I guess I no longer get notifications, while I haven't had time to sit down and look at this issue, I believe the $ not being assigned properly has everything to do with this tidbit I just found looking at some other wordpress functions:

    jQuery noConflict Wrappers
    The jQuery library included with WordPress is set to the noConflict() mode (see wp-includes/js/jquery/jquery.js). This is to prevent compatibility problems with other JavaScript libraries that WordPress can link.

    In the noConflict() mode, the global $ shortcut for jQuery is not available, so you can still use:

    jQuery(document).ready(function(){
        jQuery(#somefunction) ...
    });

    but the following will either throw an error, or use the $ shortcut as assigned by other library.

    $(document).ready(function(){
         $(#somefunction) ...
    });

    However, if you really like the short $ instead of jQuery, you can use the following wrapper around your code:

    jQuery(document).ready(function($) {
        // Inside of this function, $() will work as an alias for jQuery()
        // and other libraries also using $ will not be accessible under this shortcut
    });

    That wrapper will cause your code to be executed when the DOM is fully constructed. If, for some reason, you want your code to execute immediately instead of waiting for the DOM ready event, then you can use this wrapper method instead:

    I can not guarantee that changing $ to jQuery will fix this issue, but if you're still fighting with this, it may be worth a shot. (The issue I can see is bgmp is assigned to $ and I'm not sure jQuery.bgmp will return the proper object. Maybe Ian can shed some light on this.

    TL;DR: The issue is that if you're using other jQuery libraries, it breaks the code because of WordPress's use of noConflict.

  10. captjones
    Member
    Posted 1 year ago #

    Damn... I thought this would be a piece of cake, started with step 1: pasting functions.txt content into functions.php and that's where it ended haha.

    Warning: require_once(/data05/virt37262/domeenid/www.kadunud.com/htdocs/wp-content/themes/lespaul/library/core.php) [function.require-once]: failed to open stream: No such file or directory in /data05/virt37262/domeenid/www.kadunud.com/htdocs/wp-content/themes/lespaul/functions.php on line 147
    
    Fatal error: require_once() [function.require]: Failed opening required '/data05/virt37262/domeenid/www.kadunud.com/htdocs/wp-content/themes/lespaul/library/core.php' (include_path='.:/opt/zone/lib/php') in /data05/virt37262/domeenid/www.kadunud.com/htdocs/wp-content/themes/lespaul/functions.php on line 147

    Halp? :(

  11. captjones
    Member
    Posted 1 year ago #

    Replaced the functions.php with backup one but no luck lol.

    EDIT: nvm, somehow a folder got deleted in my theme directory..:D

  12. captjones
    Member
    Posted 1 year ago #

    Edit2:

    Can't get this to work,

    recorded my attempt. Should this approach work with latest plugin version?

    screenrecoring link

  13. jesse.t
    Member
    Posted 1 year ago #

    I'm not sure what version you are using, but I never merged this code with 1.9RC3 (I believe that's the versioning) Everything I wrote was with RC2, anyways, as mentioned previously, there is an issue with the use of the $ jquery shortcut which will break most installations. I built off a barebones installation with no plugins, so I did not run into the problem. Unfortunately, I haven't had the time to revisit this and see if I could come up with a work around. The short answer I would think would be to change all instances of $ to jQuery or some other noConflict variable but I haven't had a chance to test that out. I believe this would have to be done within the plugins jQuery file as well as the one I written so that the bgmp variable carries over. Again, I have not tested this, so I cannot guarantee that would be a fix, but I think it's a good starting point.

  14. captjones
    Member
    Posted 1 year ago #

    Hey Jesse,

    Since I failed with the map installation I used yours as an example instead to develop a filterable map. I hope you don't mind *ashamed*.
    Anyways,
    I added sub-menus like so, ,
    and now I gotta ask you a question:
    how do you make locations on map hide by default? I got thousands of markers coming on a country smaller than New York and it would be disastrous haha.

  15. jesse.t
    Member
    Posted 1 year ago #

    Well I think my answer should be 2 fold. I use the show/hideMarkers() function in my code to hide them, but I check to see if they are within the current visible bounds:

    [code]
    hideMarkers();
    bounds = $.bgmp.map.getBounds();
    //show only the markers that should be visible
    showMarkers();
    [/code]

    The bounds is what is visible on the viewport of your map. everything outside of that is hidden.

    [code]
    google.maps.event.addListener($.bgmp.map, 'bounds_changed', function () {
    bounds = $.bgmp.map.getBounds();
    window.setTimeout(function() {
    html = "";
    showMarkers();
    }, 300);
    });
    [/code]

    All of this is listed in my javascript for you to look at with some documentation as to where I found the solutions (Google API links and stackoverflow were great while learning this.)

    Now the second part is that if you're site is going to be flooded with markers, you may need to use the clustering option that Ian added. I haven't came back to this project in a while, but I may look to see how that works with my current code. To be honest, if you're familiar enough with javascript the Google API will be great on helping you walk through everything. Like I said before the only barrier with my current code is mapping the $ variable without causing conflict. If you can access the bgmp variable with a noConflict then it's golden.

    Feel free to use anything from my work needed. I only wish it worked out of the box, but I don't really have time to troubleshoot it properly.

  16. captjones
    Member
    Posted 1 year ago #

    Thanks for reply brah, not sure if I did anything wrong or what,but
    in this line

    $('#map-buttons').append('<li class="buttons" style="display:none;" data-type="'+arr+'"'+'><a href="#" class="selected"><div class="inset"><button class="text fNav shown" id="fNav-'+$.bgmp.markers[arr]['id']+'" value="'+arr+'"'+'>'+arr+'</button></div></a></li>');

    I removed "selected" and it worked out nicely. Do you know how to make it select/activate only 1 category when loading up map?

    It used to select all, now I got it to select none. But to select only 1 category? You should compile all your efforts man and make this thing into a premium plugin to repay all the hard work you've done.

  17. jesse.t
    Member
    Posted 1 year ago #

    Sorry. I got the email about this Saturday morning and forgot to reply. Selected was only used for my CSS I believe. Clicking the actual button with the id's is what shows/hides markers. I use ShowMarkers() to show all current markers. ShowMarkers() looks for a button with the class shown and gravs it's value to display visible markers.

  18. jesse.t
    Member
    Posted 1 year ago #

    Thanks for the kind words, but aside from the fact that my works is completely dependent on Ian's work, that wouldn't be right. Secondly, I've seen the kind of headache it would cause trying to support a plugin. It's not worth it to me. All that aside, when I have to revisit this project I'll probably take the time to fix the $ bug if nobody else has.

  19. jesse.t
    Member
    Posted 1 year ago #


  20. Ian Dunn
    Member
    Plugin Author

    Posted 1 year ago #

    Jesse, there are a couple options for importing posts from CSV, etc if you search the forums.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.