This project has moved and is read-only. For the latest updates, please go here.

Little help about the Map Template

Dec 4, 2015 at 3:54 PM
Hello Sacha,

I'm using your excellent module (OpenContent 2.0) on a multilanguage website with Map template installed.

It seems that it only renders the map (and the pins) on the default language.
On any other language it gives just the beige background and the default hand pointer.
No map and no pins...

I've tried it on a DNN 7.4.2 portal with several languages, but without Content Localization enabled, and also in another one with enabled Content Localization (both ways - module detached and un-detached) - the effect is the same - no map.

Is there something additional to add to the config-files.
Is there another way to use the map template on a multi-language website

I saw on Alpaca Docs an example:
"view": {
        "locale": "es_ES"
but don't know if it's possible to use it with the map template.

Dec 4, 2015 at 5:03 PM

i checked on a ml web site without content localization and it work fine.

Du you have javascript errors ?
If you look in the source code of the page , do you see the points in the html ?
<div class="map-items" data-mapid="map-canvas-473" data-lat="50.8427501" data-lng="4.3515499000000091" data-zoom="8" data-icon="">
    <div class="map-item" style="display:none;" data-title="title3 " data-lat="50.668081000000008" data-lng="4.6118324000000257">

        <div class="map-title">title3 </div>
        <div class="map-description">description 1</div>

Do have a public link to the website ?

If you want you can send it by email.

Dec 4, 2015 at 8:26 PM
Edited Dec 5, 2015 at 6:12 AM

Yes, I see this same div on all languages (with the same data in it).

You can take a look at the link. Just change the language to something different.

I've tried on a localhost with 2-language site without DNN Content Localization enabled and it gives me the same no-map effect :(

(DNN7.4.2 - OpenForm 2.0)

Dec 4, 2015 at 9:47 PM

In other language then english the longitude and latitude contains a , (comma) in place on . (dot) as decimal separator.

Do you use a razor template ?

Can you send me zip export of your template + the raw data.
So i will check what the problem.

Dec 4, 2015 at 10:46 PM
Edited Dec 4, 2015 at 10:47 PM

I just seen i have already made a fix for that, but was not in the online template.

I update the online template.

Here the updated template :

<div class="map-items"
     data-lat="{{formatnumber Settings.MapCenter.latitude "" "invariant"}}" data-lng="{{formatnumber Settings.MapCenter.longitude "" "invariant"}}"
    {{#each Elements}}
    <div class="map-item" style="display:none;" data-title="{{Title}}" data-lat="{{formatnumber Address.latitude  "" "invariant"}}" data-lng="{{formatnumber Address.longitude  "" "invariant"}}">

        {{#if Title}}<div class="map-title">{{Title}}</div>{{/if}}
        {{#if Description}}<div class="map-description">{{Description}}</div>{{/if}}
<div id="map-canvas-{{Context.ModuleId}}" class="map-canvas"></div>
Marked as answer by stef4620 on 12/4/2015 at 10:11 PM
Dec 5, 2015 at 6:16 AM

It works flawlessly with the updated template.

Have a nice weekend,