mhasbie / react-leaflet-easyprint

React wrapper of leaflet-easyPrint for react-leaflet. A simple leaflet plugin which adds an icon to print or export a map.
MIT License
9 stars 4 forks source link

While trying to export as a , i am getting an error message and export as png operation is failing #1

Open atulsingh0913 opened 6 years ago

atulsingh0913 commented 6 years ago
import PrintControl from 'react-leaflet-easyprint';

      <LeafletMap center={center} zoom={this.state.zoom}>

        <TileLayer attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
                    url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"/>
        <PrintControl ref={(ref) => { this.printControl = ref; }} position="topleft" sizeModes={['Current', 'A4Portrait', 'A4Landscape']} hideControlContainer={false} exportOnly={true}/>
        <PrintControl position="topleft" sizeModes={['Current', 'A4Portrait', 'A4Landscape']} hideControlContainer={false} title="Export as PNG" exportOnly={true} />
        <MyMarkersList markers={athenaClientLocations} />

      </LeafletMap>

Print operation failed

Event {isTrusted: true, type: "error", target: img.leaflet-marker-shadow.leaflet-zoom-animated, currentTarget: img.leaflet-marker-shadow.leaflet-zoom-animated, eventPhase: 2, …} bubbles:false cancelBubble:false cancelable:false composed:false currentTarget:null defaultPrevented:false eventPhase:0 isTrusted:true path:(4) [img.leaflet-marker-shadow.leaflet-zoom-animated, div.leaflet-pane.leaflet-shadow-pane, div.leaflet-pane.leaflet-map-pane, div.leaflet-container.leaflet-touch.leaflet-retina.leaflet-fade-anim.leaflet-grab.leaflet-touch-drag…] returnValue:true srcElement:null target:null timeStamp:15869.000000180677 type:"error"

mhasbie commented 5 years ago

@atulsingh0913 thanks for reporting the issue. Can you provide a jsFiddle or CodePen that can replicate this issue? That would help with troubleshooting. Thanks!

shubhanus commented 4 years ago

@atulsingh0913 Did you solved this?