-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
width undefined #32
Comments
Can you show me a snippet of how you are initiating the plugin, eg what options you are passing? |
Attached is my code.js file.
This is the index.html - built with data from code.js - when I run the app directly with AppStudio on Windows desktop:
<!DOCTYPE HTML>
<html manifest="OfflineApp.appcache">
<head>
<meta charset="utf-8">
<title>WoBinIch</title>
<meta name="generator" content="NSB/AppStudio 6.2.6.1$kqbb" />
<meta name='date' content='2017-07-27 22:45:19.873000' />
<meta name='version' content='3.0.6' />
<meta name='viewport' content='width=device-width, initial-scale=1, user-scalable=no' />
<meta name='apple-mobile-web-app-capable' content='YES' />
<meta name='mobile-web-app-capable' content='yes' />
<meta name='apple-mobile-web-app-status-bar-style' content='black-translucent' />
<meta name='apple-mobile-web-app-title' content='WoBinIch' />
<meta name='copyright' content='Copyright 2017 Bernd M. Sommer, Coburg' />
<meta http-equiv='Content-Security-Policy' content="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; media-src * blob:; img-src * data:; connect-src *;" />
<link rel='apple-touch-icon' href=' <http://127.0.0.1:56740/WoBinIchBundle/LauncherIcon180ParEu.png> LauncherIcon180ParEu.png' />
<link rel='shortcut icon' sizes='192x192' href=' <http://127.0.0.1:56740/WoBinIchBundle/LauncherIcon192ParEu.png> LauncherIcon192ParEu.png' />
<link href=" <http://127.0.0.1:56740/WoBinIchBundle/nsb/nsbstyle.css> nsb/nsbstyle.css" rel="stylesheet">
<script type="text/javascript" src=" <http://gc.kis.v2.scr.kaspersky-labs.com/8580FFD5-9E96-2C4B-8A4B-001CFF36F937/main.js> http://gc.kis.v2.scr.kaspersky-labs.com/8580FFD5-9E96-2C4B-8A4B-001CFF36F937/main.js" charset="UTF-8"></script><link rel="stylesheet" crossorigin="anonymous" href=" <http://gc.kis.v2.scr.kaspersky-labs.com/739F63FFC100-B4A8-B4C2-69E9-5DFF0858/abn/main.css> http://gc.kis.v2.scr.kaspersky-labs.com/739F63FFC100-B4A8-B4C2-69E9-5DFF0858/abn/main.css"/><script src=" <http://127.0.0.1:56740/WoBinIchBundle/nsb/jquery.js> nsb/jquery.js"></script>
<link href=" <http://127.0.0.1:56740/WoBinIchBundle/nsb/jquery.modal.min.css> nsb/jquery.modal.min.css" rel="stylesheet">
<script src=" <http://127.0.0.1:56740/WoBinIchBundle/nsb/library/navigo.min.js> nsb/library/navigo.min.js"></script>
<script src=" <http://127.0.0.1:56740/WoBinIchBundle/nsb/hfunc.js> nsb/hfunc.js"></script>
<script src=" <http://127.0.0.1:56740/WoBinIchBundle/nsb/jquery.modal.min.js> nsb/jquery.modal.min.js"></script>
<script src=" <http://127.0.0.1:56740/WoBinIchBundle/nsb/iscroll.js> nsb/iscroll.js"></script>
<link href=" <http://127.0.0.1:56740/WoBinIchBundle/nsb/jquery.mobile.css> nsb/jquery.mobile.css" rel="stylesheet">
<script src=" <http://127.0.0.1:56740/WoBinIchBundle/nsb/jquery.mobile.js> nsb/jquery.mobile.js"></script>
<script src=" <http://127.0.0.1:56740/WoBinIchBundle/nsb/jqmFunctions.js> nsb/jqmFunctions.js"></script>
<link href="chromeManifest.json <http://127.0.0.1:56740/WoBinIchBundle/chromeManifest.json> " rel="manifest">
<link rel="stylesheet" crossOrigin="anonymous" href=" <https://unpkg.com/leaflet@1.1.0/dist/leaflet.css> https://unpkg.com/leaflet@1.1.0/dist/leaflet.css"
integrity="sha512-wcw6ts8Anuw10Mzh9Ytw4pylW8+NAD4ch3lqm9lzAsTxg0GFeJgoAtxuCLREZSC5lUXdVyo/7yfsqFjQ4S+aKw=="
"/>
<script crossOrigin="anonymous" src=" <https://unpkg.com/leaflet@1.1.0/dist/leaflet.js> https://unpkg.com/leaflet@1.1.0/dist/leaflet.js"
integrity="sha512-mNqn2Wg7tSToJhvHcqfzLMU6J4mkOImSPTxVZAdo+lcPlk+GhZmYgACEe0x35K7YzW1zJ7XyJV/TT1MrdXvMcA==""
</script>
<script crossOrigin="anonymous" src=" <http://127.0.0.1:56740/WoBinIchBundle/bundle.js> bundle.js"></script>
<style type="text/css">
#Form1 {background:inherit;}
#mapContainer {position:absolute; left:2%; right:2%; top:55px; bottom:auto; height:50%; width:96%;}
#ShowMapBasicButton2 {position:absolute; left:2%; right:auto; top:5px; bottom:auto; height:auto; width:45%;}
#ShowMapToForm2Button {position:absolute; left:50%; right:auto; top:5px; bottom:auto; height:auto; width:48%;}
#TextAreaForm1 {position:absolute; left:2%; right:auto; top:560px; bottom:auto; height:59px; width:96%;}
#TextArea1 {position:absolute; left:2%; right:2%; top:60%; bottom:auto; height:34%; width:96%;}
#TextArea2 {position:absolute; left:2%; right:auto; top:95%; bottom:auto; height:auto; width:96%;}
#Form2 {background:inherit;}
#HeaderBar1 {position:absolute; width:100%; height:40px; left:0px; top:0px;}
#lblEMail {position:absolute; left:5%; right:auto; top:66px; bottom:auto; height:auto; width:20%;}
#txtEmail_wrapper {position:absolute; left:25%; right:auto; top:61px; bottom:auto; height:auto; width:70%;}
#txtEmail_wrapper {margin:0px; box-sizing:border-box;}
#lblSubject {position:absolute; left:5.0%; right:auto; top:102px; bottom:auto; height:auto; width:20%;}
#txtSubject_wrapper {position:absolute; left:25%; right:auto; top:97px; bottom:auto; height:auto; width:70%;}
#txtSubject_wrapper {margin:0px; box-sizing:border-box;}
#lblBody {position:absolute; left:5%; right:auto; top:139px; bottom:auto; height:auto; width:60px;}
#txtBody {position:absolute; left:5%; right:auto; top:168px; bottom:auto; height:240px; width:90%;}
#butSend {position:absolute; left:5%; right:auto; top:417px; bottom:auto; height:auto; width:90%;}
</style>
</head>
<body style="margin:0px;-ms-touch-action:none;font-family:helvetica;">
<noscript><h1>JavaScript must be enabled!</h1></noscript>
<div data-role="page" id="NSBPage" data-theme="" style="position:absolute; width:100%; height:100%; background-color:inherit; ">
<a name='/Form1' data-role=none></a>
<div id=Form1_scroller>
<div id="Form1" class="nsb-form" style="position:absolute; display:none; height: 100vh; top:0px; left:0px; width:100%; ">
<script>
Form1.innerHTML=["", "<div id='mapContainer' class='container-center ' style='border-width:1px; border-style:solid; border-color:#000000; ' >","<div id=mapContainer_addChild>",,"</div>","</div>",
"<button id='ShowMapBasicButton2' class='ui-btn ui-mini ui-corner-all ui-btn-inline ui-btn-b ui-icon- ui-btn-icon-none ' style='margin:0px; text-shadow:none; overflow:visible; background-color:green; ' data-nsb-type=Button_jqm>Position auf Karte</button>",
"<button id='ShowMapToForm2Button' class='ui-btn ui-mini ui-corner-all ui-btn-inline ui-btn-b ui-icon- ui-btn-icon-none ' style='margin:0px; text-shadow:none; overflow:visible; background-color:green; ' data-nsb-type=Button_jqm>Sende E-Mail</button>",
"<textarea id='TextAreaForm1' class=' ui-mini ' data-corners=false name='' style='display:none; margin-top:0px; text-align:left; overflow-scrolling:touch; max-height:auto; text-shadow:none; ' autocorrect='on' autocomplete='on' autocapitalize='on' data-autogrow=false readonly=\'readonly\' placeholder=''></textarea>",
"<textarea id='TextArea1' class=' ui-mini ' data-corners=false name='' style='display:block; margin-top:0px; text-align:left; overflow-scrolling:touch; max-height:auto; text-shadow:none; ' autocorrect='on' autocomplete='on' autocapitalize='on' data-autogrow=false readonly=\'readonly\' placeholder='Text hier eingeben'>Tippen Sie auf \"Position auf Karte\", damit eine Karte gezeigt wird. Am linken Rand ist eine Schaltfl\u00E4che mit Drucker-Symbol. Damit k\u00F6nnen Sie die Karte aus der Web-App auch als PDF speichern. Wenn Sie antippen \"Sende E-Mail\" und dann \"Senden\", k\u00F6nnen Sie die gespeicherte Karte in Ihrem E-Mail-Programm als Anhang ausw\u00E4hlen und senden. In der nativen App (.apk) k\u00F6nnen Sie mit dem Ger\u00E4t einen Screenshot fertigen und diesen aus der Galerie drucken oder senden.</textarea>",
"<textarea id='TextArea2' class=' ui-mini ' data-corners=false name='' style='display:block; margin-top:0px; text-align:center; overflow-scrolling:touch; max-height:auto; text-shadow:none; ' autocorrect='on' autocomplete='on' autocapitalize='on' data-autogrow=false readonly=\'readonly\' placeholder='Text hier eingeben'>(C) 2017 Bernd M. Sommer, Coburg. Version Juli_16</textarea>",
].join('');
</script>
</div>
</div>
<a name='/Form2' data-role=none></a>
<div id="Form2" class="nsb-form" style="position:absolute; display:none; height: 100vh; top:0px; left:0px; width:100%; ">
<script>
Form2.innerHTML=["", NSB.HeaderBar_jqm14('HeaderBar1', 'E-Mail', '', 'arrow-l', 'left', '', 'arrow-r', 'none', ' style="" class=" "', '', ''),
"<div id='lblEMail' class='' data-nsb-type=Label style='cursor:default; text-shadow:none; font-size:16px; font-weight:bold; background-color:durchsichtig; '>An:</div>",
"<input id='txtEmail' type='text' name='' autocorrect='on' autocomplete='on' autocapitalize='on' step=any value='' placeholder='E-Mail Adresse' data-nsb-type='TextBox_jqm' style='text-shadow:none;' class=' ui-mini '>",
"<div id='lblSubject' class='' data-nsb-type=Label style='cursor:default; text-shadow:none; font-size:16px; font-weight:bold; background-color:durchsichtig; '>Betr.:</div>",
"<input id='txtSubject' type='text' name='' autocorrect='on' autocomplete='on' autocapitalize='on' step=any value='' placeholder='Text hier eingeben' data-nsb-type='TextBox_jqm' style='text-shadow:none;' class=' ui-mini '>",
"<div id='lblBody' class='' data-nsb-type=Label style='cursor:default; text-shadow:none; font-size:16px; font-weight:bold; background-color:durchsichtig; '>Inhalt:</div>",
"<textarea id='txtBody' class=' ui-mini ' data-corners=false name='' style='display:block; margin-top:0px; text-align:left; overflow-scrolling:touch; max-height:auto; text-shadow:none; ' autocorrect='on' autocomplete='on' autocapitalize='on' data-autogrow=false placeholder='Text hier eingeben'></textarea>",
"<button id='butSend' class='ui-btn ui-mini ui-btn-inline ui-icon- ui-btn-icon-none ' style='margin:0px; text-shadow:none; overflow:visible; ' data-nsb-type=Button_jqm>Senden</button>",
].join('');
</script>
</div>
</div>
<script>
if(!navigator.cookieEnabled) NSB.MsgBox('Please turn cookies on.');
(function(){var all=document.getElementsByTagName('*');for(var i=0;i<all.length;i++)if(all[i].id!=''&&typeof all[i].id!='undefined'&&typeof window[all[i].id]=='undefined')window[all[i].id]=all[i];})()
var NSB = NSB || {};
NSB.currentForm = Form1;
NSB.stopOnError = False;
NSB.enableBrowserArrows = true;
NSB.enableAppScroll = false;
NSB.newVersionWarning = true;
NSB.id = 'Project2';
NSB.voltAppId = '';
NSB.voltDashboardAccess = False;
NSB.voltDomain = '';
var router = new Navigo(null, !false);
router.on(function() {ChangeFormAction(Form1);});
if ($.mobile != undefined) $.mobile.hashListeningEnabled = false;
// ***** Code for form: Form1 *****
window.addEventListener('load', function() {
Form1.style.display = 'block';
Form1_ref = new IScroll(Form1_scroller,{mouseWheel:true, scrollbars:true, bounce:true, zoom:false});
Form1.ref = Form1_ref;
Form1.scroller = Form1_scroller;
NSB.addProperties(Form1);
NSB.addProperties.addChild(mapContainer);
NSB.addProperties(mapContainer);
NSB.addDisableProperty(ShowMapBasicButton2);
NSB.addProperties(ShowMapBasicButton2);
NSB.addDisableProperty(ShowMapToForm2Button);
NSB.addProperties(ShowMapToForm2Button);
TextAreaForm1.ontouchmove=function(e){e.stopPropagation()};
NSB.addProperties(TextAreaForm1);
$('#TextAreaForm1').removeClass('ui-shadow-inset');
TextArea1.ontouchmove=function(e){e.stopPropagation()};
NSB.addProperties(TextArea1);
$('#TextArea1').removeClass('ui-shadow-inset');
TextArea2.ontouchmove=function(e){e.stopPropagation()};
NSB.addProperties(TextArea2);
$('#TextArea2').removeClass('ui-shadow-inset');
Form1.style.display = 'none';
router.on({'Form1': function() {ChangeFormAction(Form1)}});
}, false);
// ***** Code for form: Form2 *****
window.addEventListener('load', function() {
Form2.style.display = 'block';
NSB.addProperties(Form2);
NSB.addProperties(HeaderBar1);
NSB.addDisableProperty(HeaderBar1);
if(typeof(HeaderBar1.onclick)=='function'){
if(typeof(HeaderBar1_left)!='undefined') HeaderBar1_left.onclick=function() {HeaderBar1.onclick(HeaderBar1_left.getAttribute('nsbvalue'))};
if(typeof(HeaderBar1_right)!='undefined') HeaderBar1_right.onclick=function() {HeaderBar1.onclick(HeaderBar1_right.getAttribute('nsbvalue'))}};
NSB.addProperties(lblEMail);
txtEmail.parentElement.id = 'txtEmail_wrapper';
txtEmail_wrapper.setAttribute('data-nsb-type', 'TextBox_jqm');
txtEmail.addEventListener('touchmove', function(e) {e.stopPropagation();}, false);
NSB.addProperties(txtEmail, txtEmail_wrapper);
$('#txtEmail_wrapper').removeClass('ui-shadow-inset');
$('#txtEmail_wrapper').removeClass('ui-corner-all');
txtEmail.style.height = (txtEmail.clientHeight + 2) + 'px';
NSB.addDisableProperty(txtEmail);
NSB.addProperties(lblSubject);
txtSubject.parentElement.id = 'txtSubject_wrapper';
txtSubject_wrapper.setAttribute('data-nsb-type', 'TextBox_jqm');
txtSubject.addEventListener('touchmove', function(e) {e.stopPropagation();}, false);
NSB.addProperties(txtSubject, txtSubject_wrapper);
$('#txtSubject_wrapper').removeClass('ui-shadow-inset');
$('#txtSubject_wrapper').removeClass('ui-corner-all');
txtSubject.style.height = (txtSubject.clientHeight + 2) + 'px';
NSB.addDisableProperty(txtSubject);
NSB.addProperties(lblBody);
txtBody.ontouchmove=function(e){e.stopPropagation()};
NSB.addProperties(txtBody);
$('#txtBody').removeClass('ui-shadow-inset');
NSB.addDisableProperty(butSend);
NSB.addProperties(butSend);
Form2.style.display = 'none';
router.on({'Form2': function() {ChangeFormAction(Form2)}});
}, false);
window.addEventListener('orientationchange', function(){window.scrollTo(0,0)});
window.addEventListener('load', function() {
browserWarningMessage('Bitte verwenden Sie MS Edge oder IE11, Google Chrome, Apple Safari oder einen anderen unterstützten Browser.');
router.resolve();
Main();
if (typeof(Form1.onshow)=='function') Form1.onshow();
}, false);
</script>
<script src=' <http://127.0.0.1:56740/WoBinIchBundle/code.js> code.js'></script>
</body>
</html>
Von: Rowan Winsemius [mailto:notifications@github.com]
Gesendet: Donnerstag, 27. Juli 2017 22:36
An: rowanwins/leaflet-easyPrint <leaflet-easyPrint@noreply.github.com>
Cc: sommerbernd <bsommer@bsommer.de>; Author <author@noreply.github.com>
Betreff: Re: [rowanwins/leaflet-easyPrint] width undefined (#32)
Can you show me a snippet of how you are initiating the plugin, eg what options you are passing?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#32 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AF5h5X9i5ukzp7X_BOBsemd6Lp5s0dmRks5sSPS7gaJpZM4OlkB4> . <https://github.com/notifications/beacon/AF5h5QDvW3Aril308oonZxm5oBzRHIYPks5sSPS7gaJpZM4OlkB4.gif>
|
This is the contents of code.js:
mapNSB = L.map(mapContainer);
L.easyPrint({
title: 'Sie können auch als PDF drucken/speichern und die Karte als Anhang senden!',
position: 'topleft',
sizeModes: ['Current','A4Portrait', 'A4Landscape'],
exportOnly: true,
filename: 'MeinePositionKarte'
}).addTo(mapNSB);
ShowMapBasicButton2.onclick = function() {
mapNSB.locate({
setView: true,
enableHighAccuracy: true,
maximumAge: 15000,
timeout: 3000000
});
mapNSB.on("locationfound", onLocationFound);
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: "<a href='https://openstreetmap.org/copyright'>OpenStreetMap</a> contributors",
crossOrigin: true
}).addTo(mapNSB);
};
function onLocationFound(e) {
var radius = e.accuracy / 2;
L.marker(e.latlng).addTo(mapNSB).bindPopup("Befinde mich ungefähr im Radius von " + radius + "m um diesen Punkt.").openPopup();
L.circle(e.latlng, radius).addTo(mapNSB);
breiteStr = e.latlng.lat.toString();
laengeStr = e.latlng.lng.toString();
TextAreaForm1.value = "Koordinaten " + breiteStr + " (Breite) und " + laengeStr + " (Laenge) kopieren und in Maps App zur Darstellung in Karte einfuegen.";
}
ShowMapToForm2Button.onclick=function(){
ChangeForm(Form2);
txtBody.value = TextAreaForm1.value;
}
|
Does it happen with any of the size modes in particular or all of them? What if you try the print mode? |
without „exportOnly: true,“
I get this, permanently circling – with any size mode:
and Chrome debugger will show:
bundle.js:1 oops, something went wrong! TypeError: Cannot read property 'width' of undefined at e._resizeAndPrintMap (bundle.js:1) at bundle.js:1 at <anonymous>
Von: Rowan Winsemius [mailto:notifications@github.com]
Gesendet: Sonntag, 30. Juli 2017 11:54
An: rowanwins/leaflet-easyPrint <leaflet-easyPrint@noreply.github.com>
Cc: sommerbernd <bsommer@bsommer.de>; Author <author@noreply.github.com>
Betreff: Re: [rowanwins/leaflet-easyPrint] width undefined (#32)
Does it happen with any of the size modes in particular or all of them? What if you try the print mode?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#32 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AF5h5ZlgpX6A8WyBY3B85xgr7_7PQjdYks5sTFLLgaJpZM4OlkB4> . <https://github.com/notifications/beacon/AF5h5cuc7lHx0i9JrZslYVrz-3gaFm-Uks5sTFLLgaJpZM4OlkB4.gif>
|
Hi @sommerbernd I've just published v2.1.0 to npm so perhaps try and install that and see how you go. I've also included a sourcemap so hopefully that should give you a more meaningful look at where the error is coming from. Let me know how you get on |
Thanks. Demo v2 is working fine. My adaptation is not:
Uncaught TypeError: Cannot read property 'isLoading' of undefined
at bundle.js:1
(anonymous) @ bundle.js:1
bundle.js:1 Uncaught TypeError: Cannot read property 'isLoading' of undefined
at bundle.js:1
(anonymous) @ bundle.js:1
Is it still bundle.js (think so, because your demo runs with bundle.js) or, as you write:
Usage
Step 1. Include the required js files in your document.
<script src="dist/leaflet.easyPrint.js"></script>
Bernd
Von: Rowan Winsemius [mailto:notifications@github.com]
Gesendet: Dienstag, 1. August 2017 14:15
An: rowanwins/leaflet-easyPrint <leaflet-easyPrint@noreply.github.com>
Cc: sommerbernd <bsommer@bsommer.de>; Mention <mention@noreply.github.com>
Betreff: Re: [rowanwins/leaflet-easyPrint] width undefined (#32)
Hi @sommerbernd <https://github.com/sommerbernd>
I've just published v2.1.0 to npm so perhaps try and install that and see how you go. I've also included a sourcemap so hopefully that should give you a more meaningful look at where the error is coming from.
Let me know how you get on
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#32 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AF5h5U_0_hznD-1soAdLO4-g7TOYwrwKks5sTxangaJpZM4OlkB4> . <https://github.com/notifications/beacon/AF5h5d4pSe6KMJTXm6_drPCTqI-4QN4Fks5sTxangaJpZM4OlkB4.gif>
|
Hey @sommerbernd , yeah sorry I forgot to update that bit of the docs so the So if I understand correctly you're getting this error when you try to integrate an leaflet app with the plugin into AppStudio. If I look at the AppStudio website it looks like it's being deprecated. I don't really have any idea about AppStudio or it's development so I probably can't provide any assistance sorry. |
Hi @rowanwins
Thanks. The one and only problem in my case seems to be: how to get “width” (of what?) defined so that bundle.js can handle it.
Sorry that I did not deliver the precise url: https://www.nsbasic.com/ .
In the beginning they called the tool “nsbasic”. It translated a sort of Basic into JavaScript. Now it is “NSB/AppStudio” and one (me) usually writes code directly in JavaScript/HTML/….
Bernd
Von: Rowan Winsemius [mailto:notifications@github.com]
Gesendet: Mittwoch, 2. August 2017 06:18
An: rowanwins/leaflet-easyPrint <leaflet-easyPrint@noreply.github.com>
Cc: sommerbernd <bsommer@bsommer.de>; Mention <mention@noreply.github.com>
Betreff: Re: [rowanwins/leaflet-easyPrint] width undefined (#32)
Hey @sommerbernd <https://github.com/sommerbernd> ,
yeah sorry I forgot to update that bit of the docs so thebundle.js is correct.
So if I understand correctly you're getting this error when you try to integrate an leaflet app with the plugin into AppStudio. If I look at the AppStudio website <https://appstudio.windows.com/en-us> it looks like it's being deprecated. I don't really have any idea about AppStudio or it's development so I probably can't provide any assistance sorry.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#32 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AF5h5S7b8amW7nTIadaqNM8vpuD24Z-cks5sT_iOgaJpZM4OlkB4> . <https://github.com/notifications/beacon/AF5h5Uia-3zvCglb5fi1LrIeRsMFfGiUks5sT_iOgaJpZM4OlkB4.gif>
|
Hmm ok, so looking at your config you aren't passing in a tile layer which is why you might be getting this issue So I'd probably have code look something like
Notice that I've added the This is a bug in my code that means it's looking for this config option even though it's not mandatory. So I'll release a fix but the above should hopefully get you past the bug for the timebeing. |
Thanks so much.
I tried this. Always error with “width … undefined”.
I am sure that it is a problem with my code. Don’t worry.
Kind regards
Bernd
Von: Rowan Winsemius [mailto:notifications@github.com]
Gesendet: Mittwoch, 2. August 2017 09:36
An: rowanwins/leaflet-easyPrint <leaflet-easyPrint@noreply.github.com>
Cc: sommerbernd <bsommer@bsommer.de>; Mention <mention@noreply.github.com>
Betreff: Re: [rowanwins/leaflet-easyPrint] width undefined (#32)
Hmm ok, so looking at your config you aren't passing in a tile layer which is why you might be getting this issue bundle.js:1 Uncaught TypeError: Cannot read property 'isLoading' of undefined
So I'd probably have code look something like
var tiles = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png <https://%7bs%7d.tile.openstreetmap.org/%7bz%7d/%7bx%7d/%7by%7d.png> ", {
attribution: "<a href='https://openstreetmap.org/copyright'>OpenStreetMap</a> contributors",
crossOrigin: true
}).addTo(mapNSB);
L.easyPrint({
title: 'Sie können auch als PDF drucken/speichern und die Karte als Anhang senden!',
tileLayer: tiles,
position: 'topleft',
sizeModes: ['Current','A4Portrait', 'A4Landscape'],
exportOnly: true,
filename: 'MeinePositionKarte'
}).addTo(mapNSB);
Notice that I've added the tileLayer property to the options.
This is a bug in my code that means it's looking for this config option even though it's not mandatory. So I'll release a fix but the above should hopefully get you past the bug for the timebeing.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#32 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AF5h5YwKLSx3lKi_O16oA1WSFyPdzGarks5sUCbegaJpZM4OlkB4> . <https://github.com/notifications/beacon/AF5h5cI73cHyKo1_dLrhYYJyKiy515qrks5sUCbegaJpZM4OlkB4.gif>
|
@rowanwins
Me again. Updated demo is working. But when I try to save a map shown in my own app I get this error with Chrome debugger:
bundle.js:1 oops, something went wrong! TypeError: Cannot read property 'width' of undefined
at e._resizeAndPrintMap (bundle.js:1)
at bundle.js:1
at
Setting the width of the map container to 900px (instead of 96%) does not help. Can I do something else to make my app save the map?
bsommer@bsommer.de
The text was updated successfully, but these errors were encountered: