Mapstore2 in geonode embed view, fontawesome error

102 views
Skip to first unread message

Toni Schoenbuchner

unread,
Nov 16, 2021, 4:05:32 AM11/16/21
to mapstore-developers
Hi guys,

this might be easy but I might miss something. Within geonode mapstore2 changes the set of available plugins based on:

{% include './_geonode_config.html' with plugins_config_key='map_embed' %} in map_embed.html

as I do need the search functionality in my embeded map I've changed it to 
{% include './_geonode_config.html' with plugins_config_key='map_view' %} Further added font-aweseome to the template head. The network tabs shows that font-awesome is loaded correctly, but mapstore keeps on telling: The font family font-awesome is not correctly loaded. Some elements (like symbols in markers) can have rendering problems How do I need to load font-awesome in embed views so that mapstore is happy? Thanks; Toni

Toni Schoenbuchner

unread,
Nov 16, 2021, 7:26:34 AM11/16/21
to mapstore-developers
My problem got solved by using 4.7 as cdn
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" integrity="sha512-5A8nwdMOWrSz20fDsjczgUidUBR8liPYU+WymTZP1lmY9G6Oc7HlZv156XqnsgNUzTyMefFTcsFH/tnJE/+xBg==" crossorigin="anonymous" referrerpolicy="no-referrer" />

Stefano Bovio

unread,
Nov 17, 2021, 12:53:51 PM11/17/21
to mapstore-...@googlegroups.com
Hi Toni,

confirm that the version is 4.7,

https://github.com/GeoNode/geonode-mapstore-client/blob/master/geonode_mapstore_client/client/package.json#L34

it is the same version used by geonode so you should be able to import the one inside the static

<link rel="stylesheet" href="{% static 'geonode/css/font-awesome.min.css' %}" />


The network tabs shows that font-awesome is loaded correctly, but mapstore keeps on telling: The font family font-awesome is not correctly loaded. Some elements (like symbols in markers) can have rendering problems

I think mapstore is trying to import the font awesome css anyway
but it should block the dynamic load ifthe shouldLoadFont cfg is set to false in the map plugin


as I do need the search functionality in my embeded map I've changed it to 

if you need to add only the search functionality you could try to manipulate the local config with  _geonode_config.html templarte
instead to change the key so you can have two different configurations for the embed and view/edit contexts

https://github.com/GeoNode/geonode-mapstore-client#customization-via-configurationstemplates

it should be something like this
{% extends 'geonode-mapstore-client/_geonode_config.html' %}
{% block override_local_config %}
<script>
    window.__GEONODE_CONFIG__.overrideLocalConfig = function(localConfig) {
        localConfig.plugins.map_embed.push({ "name": "Search" });
        return localConfig;
    };
</script>
{% endblock %}

Thanks,

Stefano

--
You received this message because you are subscribed to the Google Groups "mapstore-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-develo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mapstore-developers/f8968ed7-34a2-46b7-9b0f-16398816b7f4n%40googlegroups.com.


--

Regards,

Stefano Bovio

==

GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

==

Stefano Bovio

Frontend Software Engineer


GeoSolutions Group
phone: +39 0584 962313

fax:     +39 0584 1660272

mob:   +39  333 8128928


https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it

-------------------------------------------------------


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Toni Schoenbuchner

unread,
Nov 18, 2021, 2:48:28 AM11/18/21
to mapstore-developers
Dear Stefano,

thanks for your reply! This is what wondered. geonode/css/font-awesome.min.css is 4.7 as well. I hence first linked it, as the map_edit view does so. However, this triggered the font warning. Using a fw v4.7 from CDN made the font check happy. The only explanation I currently have is it might have todo with the iframe the map is loaded into. Maybe some policy issue (but also this would wonder as I see it is correctly loaded). Anyways, It's working, and using a CDN isn't so bad either ;)

Thanks also for the config hint! bookmarked!

cheers,

Toni

Reply all
Reply to author
Forward
0 new messages