• Hello Robert,
    I am getting an Uncaught SyntaxError: Unexpected identifier javascript error, but only when displaying a layer map or when on the backend on the layer maps screen.

    I deleted all my created markers, just to see if has anything to do with this. Also switched off my other map plugin/add on. Have you experienced any issues on layer maps?
    S

    https://wordpress.org/plugins/leaflet-maps-marker/

Viewing 14 replies - 1 through 14 (of 14 total)
  • cant remember having seen this issue – is there a possibility to have a look at your site?

    Thread Starter landwire

    (@landwire)

    Thread Starter landwire

    (@landwire)

    Also, if you look at the map, there is a biggish grey empty bit at the top, which is not very nice. Not sure if you can centre the map when on zoom 1 so that no grey areas are shown?

    Or maybe I just have to change the centre from Vienna to somewhere else?
    S

    Hi Sascha,
    problem is the “red info box” which comes from a debugging plugin I guess – this one is also added to the output of the geojson array automatically so that this one breaks: http://2013d.landwire.net/wp-content/plugins/leaflet-maps-marker/leaflet-geojson.php?layer=1&full=no&full_icon_url=no
    best,
    Robert

    Thread Starter landwire

    (@landwire)

    Ooops & thanks!

    it’s a plugin that I have written. Maybe you could look how to make it compatible? It’s not an official plugin. I’ll send you the code if you want to have a look.
    S

    I am sorry, I dont know how to change your script. I use the following debugging plugins – perhaps they help you too:

    Debug bar
    query monitor

    best

    Thread Starter landwire

    (@landwire)

    Robert,
    how were you able to tell so quickly that this was causing an issue? Just so I know what to look out for in the future. I am using query monitor too, but that did not even pick the error up. Maybe I should try debug bar too!
    It was just shown in my console on chrome, but I just could not identify the error or what had caused it.

    I just changed the hook on that little script and it works fine now.
    Many thanks for helping me out there!
    Sascha

    Thread Starter landwire

    (@landwire)

    The issue with the grey area on zoom 1 persist though. I tried moving the map and then saving the layer map on the backend, but still it shows only with the grey area. Also on the backend.

    Any tips?

    Ok, got that resolved by going to the database and changing the layerviewlat value. Then on refresh I suddenly had a black marker at the backend which seems to centre the map. Maybe that was hidden before as I had a default marker on that same position in vienna?

    Enhancement: (maybe)
    Intuitively I would say, the map should save exactly the way you see it on the backend (without showing that black marker). I think I have seen other plugins accomplish that, like WP GEO. Anyway, just a minor thing, a bit like being able to drag the marker.
    S

    Hi Sascha,
    if you had opened to browser console, you would have seen that there is a javascript error on the page which came from the geojson file which is invalid.

    regarding grey area: please do not change values directly in the database unless it is really needed – this might bypass the sanitazion of values for example resulting in broken maps etc.

    regarding “black marker”: this is the layer center icon on layer maps. you can use this to center the map – is not shown on frontend.
    best,

    Robert

    Thread Starter landwire

    (@landwire)

    Hmm, I did look in console, but sometimes it’s just all blank in there with only the error showing up, but no other code. Anyway, might reproduce that error again and then see if I can find it πŸ™‚

    Backend layer maps:
    The problem I had was that the “black marker” was not showing at all and therefore I could not change the position of the map, until I changed the value of “layerviewlat”. Usually I would not touch the DB.

    I will try to reproduce to see if it is a bug. I report back.
    S

    Thread Starter landwire

    (@landwire)

    Ok, “black marker” was showing, BUT a new marker on default location hides the “black marker” more or less completely. Now I know what to look for πŸ™‚

    To reproduce:

    1. Create layer map
    2. Create marker on that layer map -> make sure coordinates are exactly the same
    3. Go to layer map in backend -> black marker is nearly totally hidden by other marker

    BUT: once you move the “black marker” it will always stay at the top (z-index) of other markers! So that problem above only happens first time you go to the layer map until you change the setting of that “black marker”. Odd.

    But I guess it would be good to either:

    1. change the z-index on “black marker” so it is in front of any markers even when it has not been modified yet

    2. let people move/pan/zoom map and when they update it is saved (exactly as it is shown) to be shown like that on front end (no black marker would be necessary). But that might be too tricky, I do not know.

    Hi Sascha,

    youΒ΄re really keeping me busy πŸ˜‰ thanks anyway for your valuable feedback!
    with next releases the black layer center pin will always be on top (z-index: 1000) and I will also set an opacity value of 0.7 and change the hover text so that its function is clearer.
    best,

    Robert

    Thread Starter landwire

    (@landwire)

    Sorry Robert! Once I get focussed on resolving something I go a bit “mad”. I hope the feedback helps πŸ™‚

    definitely πŸ˜‰

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Uncaught SyntaxError: Unexpected identifier’ is closed to new replies.