Giter Club home page Giter Club logo

Comments (5)

cmrRose avatar cmrRose commented on August 26, 2024

I have also struggled with this, and found a partial solution.
The origin of the problem is that background is set to transparent and the color (of the icons) is set to black by some @media print rules in Bootstrap.
I was able to override these rules for Leaflet.awesome markers within the leaflet.awesome-markers css file. I added !important to the css rules for background (both for marker and marker shadow):
for example-
.awesome-marker {
background: url('images/markers-soft.png') no-repeat 0 0!important;...

I also added it to the background-position rules for each color of icon.
for example-
.awesome-marker-icon-orange {
background-position: -25px 0!important;....

I have not found a way to override the icon color changing to black (except to comment-out, or remove, that @media print rule in the bootstrap css, which may affect more than just the map markers in your webpage).
I hope this helps anyone trying to troubleshoot the problem.

from leaflet.awesome-markers.

bobleujr avatar bobleujr commented on August 26, 2024

Any news on this? I am struggling with it too! @cmrRose which rule exactly you took off? I got to something like this but it doesnt get neither the shape or the color..

screen shot 2016-05-24 at 1 02 01 pm

from leaflet.awesome-markers.

fredomgc avatar fredomgc commented on August 26, 2024

I simply downloaded Bootstrap without @media print queries (http://getbootstrap.com/customize/ ; uncheck "Print media styles").

If you are using Chrome, you must allow printing of background images and colors in Chrome print dialog.

from leaflet.awesome-markers.

baptwaels avatar baptwaels commented on August 26, 2024

Hi, were you able to print the map with the icons ? I'd like to use leaflet-image but I don't know if both libs are compatible :

This library does not rasterize HTML because browsers cannot rasterize HTML. Therefore, L.divIcon and other HTML-based features of a map, like zoom controls or legends, are not included in the output, because they are HTML. (leaflet-image)

from leaflet.awesome-markers.

habib-farhan avatar habib-farhan commented on August 26, 2024

Thanks @cmrRose !
Your solution works.

from leaflet.awesome-markers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.