Skip to content

Bootstrap Theme conflict #192

Closed
Closed

Description

@amitbend

Hi,
I'm using a custom bootstrap css theme for all of my project,
and including a folium map in one of my pages.

it cause a conflict, and it shows the bootstrap default theme.

is there a way to remove those line not manually?

Activity

  1. BibMartin commented on Aug 19, 2015

    @BibMartin
    Contributor

    Hi @amitbend ,
    can you prodive a sample of code, and show what lines are in conflict, please ?

  2. amitbend commented on Aug 19, 2015

    @amitbend
    Author

    Sure!

    this is what i see in the html file created by folium

    <head>
    ....
       <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
       <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
    </code>

    and this the map config and creation

    map_1 = folium.Map(location=def_loc, zoom_start=12, tiles='Stamen Toner', width=960, height=500)
    
    
    map_1.create_map(path=map.html')

    i'm using django so i included with this {% include 'map.html' %} tag

  3. fenimore commented on Oct 24, 2015

    @fenimore

    Hi, I have the same issue with Flask
    I managed to get a google font working, if I source the font and add the <style> manually AFTER I include the map, like so

    <div id="map"> {% include 'raw_map.html' %}</div>
    <link href='https://fonts.googleapis.com/css?family=IM+Fell+English' rel='stylesheet' type='text/css'>
    <style>
    body {
    font-family: 'IM Fell English', serif;
    }
    h1, h2, h3, h4 {
    font-family: 'IM Fell English', serif;
    }
  4. added
    enhancement
    on Nov 27, 2015
  5. ocefpaf commented on Dec 4, 2015

    @ocefpaf
    Member

    @BibMartin I am clueless when it comes to css and styling. Do you think this is easily fixed? If not let's tag v0.2.1 and start addressing this creating a test using @amitbend #192 (comment)

  6. BibMartin commented on Dec 4, 2015

    @BibMartin
    Contributor

    I guess this is resolved by v0.2.0 because you can update yourself the version of bootstrap (or any other folium lib) in doing:

    folium_map = folium.Map()
    folium_figure = m.get_root()
    folium_figure.header._children['bootstrap'] = folium.element.JavascriptLink(
        '{{another url of your choice}}')
    

    Note that I know few about Flask and Django. But if you want to ensure there's no interaction between Javascript inside and outside the map, I would include the map as an iframe. I guess you can use directly :

    <html>
        ... whatever your template ...
        {{ folium_map._repr_html_() }}
    </html>
    

    @amitbend , can you tell me whether this works ; I guess @ocefpaf is in the mood of closing issues 👻 .

  7. ocefpaf commented on Dec 4, 2015

    @ocefpaf
    Member

    I guess @ocefpaf is in the mood of closing issues 👻

    At least tagging them 😁

  8. ocefpaf commented on Feb 12, 2016

    @ocefpaf
    Member

    Closing this. If v0.2.0 still have that problem please re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions