google maps marker.png 404 error

Markers are not showing on my Google Maps. I looked at the Java Console and this is why it's giving me a 404 error:

http://www.windingcreekchurch.org/wp-content/plugins/wpmu_dev_maps_plugin/i…s_plugin/img/wp-content/plugins/wpmu_dev_maps_plugin/img/system/marker.png 404 (Not Found)

Ther'es some sort of extraneous i...se_plugin being sent to the URL. The marker.png file is in the img/system directory but somehow the URL is being re-written so it can't be found to display on tha map.

  • Vinod Dalvi
    • WP Unicorn

    Hi @Richard,

    Greetings and thanks for posting on the forums.

    I have tested it on my test using latest version of Google Maps plugin and found it's working fine displaying Markers.

    Could you please share me the page link where you are using Google Maps so that i can troubleshoot it?

    Also would you mind if I logged in to your site and did some testing? This might help get to the bottom of this faster. If this is ok, just grant me temporary admin access to your site by clicking "Grant Access" button in the WPMU DEV Dashboard Settings from the following path and reply on this thread after granting it?

    Admin -> WPMU DEV -> Support -> Support Access Tab

    Kind Regards,
    Vinod Dalvi

  • Rich
    • Site Builder, Child of Zeus

    Failed to load resource: the server responded with a status of 404 (Not Found) http://www.windingcreekchurch.org/wp-content/plugins/wpmu_dev_maps_plugin/i…s_plugin/img/wp-content/plugins/wpmu_dev_maps_plugin/img/system/marker.png

    I looked at the code and it looks like this is how the markers are referenced:

    icon = _agm.root_url + '/img/system/marker.png';

    It appears that something is causing _agm.root_url to pass the wrong argument.

  • Vinod Dalvi
    • WP Unicorn

    Hi @Richard,

    Thank you for your patience.

    I checked the HTML source code of your site and found the following code generated by Google Maps plugin.

    <script type="text/javascript">var _agm = {"ajax_url":"http:\/\/www.windingcreekchurch.org\/wp-admin\/admin-ajax.php","root_url":"\/wp-content\/plugins\/wpmu_dev_maps_plugin","is_multisite":0,"libraries":["panoramio"]};</script>

    In the above code root_url is displaying wrong which may be causing this issue. The root_url should be as following.

    http:\/\/www.windingcreekchurch.org\/wp-content\/plugins\/wpmu_dev_maps_plugin

    Though it's working fine on my site.

    Could you please try deleting and reinstalling the fresh version of Google Maps plugin?

    If it doesn't help you then try editing the following file of Google Maps plugin changing constant from WPMU_PLUGIN_URL to the function plugins_url() on line numbers 35, 40 and 45.

    Google Maps plugin file:
    wpmu_dev_maps_plugin/wpmu_dev_maps_plugin.php

    Best Regards,
    Vinod Dalvi

  • Rich
    • Site Builder, Child of Zeus

    Deleting and re-installing did not resolve the problem. Here is how lines 35, 40, and 45 read below. As you can see, WPMU_PLUGIN_URL exists for only line 35 and changing that didn't fix the problem.

    line 35: define( 'AGM_PLUGIN_URL', str_replace( 'http://', (@$_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'), WPMU_PLUGIN_URL ), true );

    line 40: define( 'AGM_PLUGIN_URL', str_replace( 'http://', (@$_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'), WP_PLUGIN_URL ) . '/' . AGM_PLUGIN_SELF_DIRNAME, true );

    line 45: define( 'AGM_PLUGIN_URL', str_replace( 'http://', (@$_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'), WP_PLUGIN_URL ), true );

  • Vaughan
    • Support/SLS MockingJay

    hi @richard,

    The root_url seems to look ok to me. but it's screwed up where the marker.png is set.

    @Vinod Dalvi meant could you edit that line.

    define( 'AGM_PLUGIN_URL', str_replace( 'http://', (@$_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'), WPMU_PLUGIN_URL ), true );

    change to

    define( 'AGM_PLUGIN_URL', str_replace( 'http://', (@$_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'), plugins_url() ), true );

    Hope this helps

  • Rich
    • Site Builder, Child of Zeus

    This had no effect on the problem. Just o be clear what I've tried:

    1. Deleting and re-installing plugin.
    2. I even deleted and re-installed and deleted the dB entries for Google Maps.
    3. I tried editing lines 35, 40, and 45 of the plugin where:

    On line 35, I replaced WPMU_PLUGIN_DIR with plugins_url()

    Did not solve the problem.

    4. I tried replacing WP_PLUGIN_URL with plugins_url() on lines 40 and 45.

    Did not solve the problem.

    I don't know what to do but this is really frustrating.

    The where_am_i-user.js is getting some funky url. Where is agm.root_url even defined anywhere in the code? Cloud that be the problem?

    Same with whatever is defining my markers because they aren't showing up either in the backend or the frontend of the site.

  • Rich
    • Site Builder, Child of Zeus

    I think I found the culprits:

    Line 180 of google_maps_user.js reads:
    icon = icon.match(/^https?:\/\//) ? icon : _agm.root_url + '/img/' + icon;

    Isn't that self-referencing?

    When I changed this to:
    icon = icon.match(/^https?:\/\//) ? icon : _agm.root_url + '/img/marker.png';

    The icon appears.

    The same problem is found in Line 422 of google_maps_admin.js on line 422:

    icon = _agm.root_url + '/img/' + icon;

    Same problem with where_am_i-user.js on lin 14:

    ? (_agmWmi.icon.match(/^https?:\/\//) ? _agmWmi.icon : _agm.root_url + '/img/' + _agmWmi.icon)

    And on line 26:
    ? (_agmWmi.icon.match(/^https?:\/\//) ? _agmWmi.icon : _agm.root_url + '/img/' + _agmWmi.icon)

    Am I seriously the only one experiencing this problem? This would explain the really strange URL's that look like this:

    http://www.windingcreekchurch.org/wp-content/plugins/wpmu_dev_maps_plugin/img//wp-content/plugins/wpmu_dev_maps_plugin/img//wp-content/plugins/wpmu_dev_maps_plugin/img/system/marker.png

    Notice that if a URL is formed by adding the icon to the end then this makes perfect sense.

  • Vinod Dalvi
    • WP Unicorn

    Hi @Richard,

    Our developer might have missed this thread in his feed therefore i have notified the developer again to get his reply here but please keep in mind though that plugin developers have a lot of responsibilities so this might take a bit longer than a normal ticket.

    In the meanwhile you can just temporary edit the plugin code to make it work as you have described in your following reply.

    https://premium.wpmudev.org/forums/topic/google-maps-markerpng-404-error#post-716343

    Thanks,
    Vinod Dalvi

    • Rich
      • Site Builder, Child of Zeus

      I understand the developer may be busy but the plugin looks to have code which breaks core functionality of the plugin. I would think he would want to investigate and remediate this problem as a top priority. I already edited the code so it works for me but it's a workaround.

  • Philipp Stracker
    • The Crimson Coder

    Hi @Richard and everyone else!

    Thanks for reporting and sorry for my late response, this thread somehow slipped my attention...
    I have reviewed the plugin just now but could not observe the issue you are having on our testing installations.

    However, I found the theoretical cause of the issue and hopefully could fix it. Since your installation currently works I will spend some more time to investigate this issue and test the changes before publishing the updated plugin.

    Since you spent some time debugging the plugin already I want to add a short info on your results:

    The following code is correct, because the variable "icon" can be either a filename (marker.png) or a full URL to an image (http://...)

    Line 180 of google_maps_user.js reads:
    icon = icon.match(/^https?:\/\//) ? icon : _agm.root_url + '/img/' + icon;

    The changes you made works for you, since you always display the default marker icon - when you try to use a different marker-icon you will not be successful... The actual problem is, that _agm.root_url is wrong (it should a full URL starting with 'http://' - this is what will be fixed in the next update)

  • Philipp Stracker
    • The Crimson Coder

    Hi Richard,

    we are currently working on an update of the maps-plugin that addresses this and some other small issues that we found. Currently it looks like the update will be ready in a few days - possibly sometime next week, but I cannot guarantee this...

    As of my current knowledge there is no issue on your site as you modified the javascript file already - is this right?
    In case there is no problem with the markers at the moment I would suggest that we finish and test the new update and you'll install it when it's ready.
    If you currently still have problems with the markers, then I can provide you with a beta-version of the update where your issue is fixed already (however, the changes are not tested in much detail yet)

    Please let us know if you wait for the update or need a quicker fix!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.