1. Mikhail Korobov
  2. django-easy-maps
  3. Pull requests

Pull requests

#1 Merged at 343787f

Add a static img tag inside a noscript as a fallback in case javascript is disabled

  1. Erik Simmler

It uses all of the settings defined by the template tag, so it looks almost identical to the js map. Since it's in a noscript, the browser shouldn't download it unless needed.

Thanks! - Erik

Comments (4)

  1. Mikhail Korobov repo owner

    Hi Erik,

    Good idea!

    A couple of notes:

    1. Can you please wrap "noscript" definition into {% block noscript %} block for easier customization;
    2. there is {{ map.longitude }} but {{ latitude }} ;
    3. I think float constants must be formatted explicitly with dots using |stringformat:"f" because otherwise localization may take an effect;

    Actually integer constants (including map.pk, zoom, etc.) also have to be explicitly formatted because of localization (there is a thousand separator in some locales). We can't use https://docs.djangoproject.com/en/1.3/topics/i18n/localization/#template-tags for that because the unlocalize the filter and 'localize off' template tag are both new in django 1.3 and django-easy-maps supports django 1.2.

    I can address these issues myself but this will take some time and it will be great if you'll update the pull request.

  2. Erik Simmler author

    Whoops, totally should have done 1 initially, and sorry about the typo for 2. Both are fixed.

    3 is a new one for me. I haven't bumped into integers being auto converted. Good to know! I took the liberty of converting lat/long in a {% with %}{% endwith %} so it only needs to be done once, and it makes the links a lot saner. Also, it looks like zoom/height/width/etc... are already strings, so they should be good to go.

    Let me know if you need anything else!

      1. Erik Simmler author

        There's my name (thanks!). Sorry about the {% with %} syntax. I suppose I'm a little spoiled by not having to worry about 1.2 very often. Have a good one!