Node JS Leaflet tile serving from same domain error - javascript

I have been using the script at: http://leaflet-cdn.s3.amazonaws.com/build/master/leaflet.js
running this web application to overlay tilelayers: http://www.wherewillplantsgrow.com/
Since 2 days ago, an issue has started where tiles start getting called where they weren't called before causing slow tiles serving and tiles images not found errors.
The map js code gist is here:
https://gist.github.com/abdelhas/40cd9d1ed932578bb6cf
My question is has anyone encountered this issue before? is there a problem with my script (i haven't touched it for a week now) or with the leaflet script above (possibly after an update).
Thank you in advance!

Don't use http://leaflet-cdn.s3.amazonaws.com/build/master/leaflet.js: the version behind that script will change. Use a versioned URL: see the 'Use a Hosted Version' of Leaflet part of this page

Related

Old mapping showing up with Workspaces. How can I establish a new mapping and/or close out a previously used port?

So this is a follow up question to an earlier question I had regarding a Udemy course on "Advanced Javascript I am taking. I am currently trying to follow along with a lesson on IIFE.
The instructor is using Chrome DevTools to show JS examples, and created the following three snippets - main.js, other.js, index.html.
As per an earlier question I had answered, it appears that the instructor is using Workspaces to map files from a local directory to work on them in Chrome DevTools (otherwise the index.html wouldn't function in DevTools just using snippets)
So... I paused the Udemy course to complete this short Workspaces demo. After completing the demo, I went back to the Udemy course, created a local directory with the main.js, other.js, and index.html files and tried to follow the instructions per the Workspaces demo for my Udemy files.
However, after running in my js-advanced/IIFE directory and navigating to localhost:8000 in Chrome, I still see the old index.html from the Workspaces demo. Even after navigating to Sources > Filesystem and opening up the new folder, I can't get the page to map to my new directory.
I am assuming that there's something I'm missing regarding ports being opened and not closed after following the tutorial. But maybe not. Can someone please explain what I'm doing wrong?
P.S. I'm technically using Brave Browser but it's built on top of Chrome so I don't think that should matter.

Source Map Error [duplicate]

This question already has answers here:
jQuery's jquery-1.10.2.min.map is triggering a 404 (Not Found)
(11 answers)
Closed 9 years ago.
I've recently started having this problem with all my projects. When my index page loads which contains a reference to the jquery source file, my console logs this error: GET http://localhost:3000/js/lib/jquery-1.10.2.min.map 500 (Internal Server Error).
This doesn't affect my application at all, but it's really annoying to see whenever I open up the console. Does anyone know where this is coming from?
Edit: Note that I'm not explicitly referencing the .map file, I am just pointing to <script src="js/lib/jquery-1.10.2.min.js"></script>
jQuery recently started using source maps.
For example, let's look at the minified jQuery 2.0.3 file's first few lines.
/*! jQuery v2.0.3 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//# sourceMappingURL=jquery.min.map
*/
Excerpt from Introduction to JavaScript Source Maps:
Have you ever found yourself wishing you could keep your client-side
code readable and more importantly debuggable even after you've
combined and minified it, without impacting performance? Well now you
can through the magic of source maps.
Basically it's a way to map a combined/minified file back to an
unbuilt state. When you build for production, along with minifying and
combining your JavaScript files, you generate a source map which holds
information about your original files. When you query a certain line
and column number in your generated JavaScript you can do a lookup in
the source map which returns the original location. Developer tools
(currently WebKit nightly builds, Google Chrome, or Firefox 23+) can
parse the source map automatically and make it appear as though you're
running unminified and uncombined files.
emphasis mine
It's incredibly useful, and will only download if the user opens dev tools.
Solution
Remove the source mapping line, or do nothing. It isn't really a problem.
Side note: your server should return 404, not 500. It could point to a security problem if this happens in production.
I had similar expirience like yours. I have Denwer server. When I loaded my http://new.new local site without using via script src jquery.min.js file at index.php in Chrome I got error 500 jquery.min.map in console. I resolved this problem simply - I disabled extension Wunderlist in Chrome and voila - I never see this error more. Although, No, I found this error again - when Wunderlist have been on again. So, check your extensions and try to disable all of them or some of them or one by one. Good luck!

how to use google maps in meteor cordova app for IOS

I have been trying to get google maps working with meteor and cordova on IOS (testing with simulator), but after tinkering with for longer than I care to admit, I just can't get it working.
I started with the article:
http://blog.thebakery.io/native-ios-maps-with-meteor-and-cordova/
I manage to install and compile it successfully after I generating google app keys for both Android and IOS and adding them to mobile-config.js as follows:
App.configurePlugin('plugin.google.maps', {
'API_KEY_FOR_ANDROID': 'my-andriod-key',
'API_KEY_FOR_IOS': 'my-ios-key'
});
When I tried to run it though, all I got was a blank white screen.
I then looked around for an alternative and found:
https://github.com/gwendall/meteor-google-maps-cordova
This also compiled without error but again all I got was a blank white screen.
After reading about a little more I also install geolocation just incase it was required:
meteor add mdg:geolocation
No joy :(
As a last attempt I tried looking for a meteor google maps implementation that did not use Cordova and lifted the template script to see if it would work.
https://github.com/dburles/meteor-google-maps-demo
No luck.
I am quite new to Meteor and so I have reached the limit of my abilities to figure it out.
Has anyone else tried implementing google-maps on Meteor with Cordova? I would appreciate any example or suggestions of how to get it working.
-- UPDATE --
After searching some meteor posts for google-maps issues I did find one that suggested adding some access rules to mobile-config.js
App.accessRule('https://*.googleapis.com/*');
App.accessRule('https://*.google.com/*');
App.accessRule('https://*.gstatic.com/*');
After this I am now at least not getting a completely blank screen. When I look at is through safari developer tools I can see there is a google-maps window generated but it is an empty grey element with a google logo in the corner and doesn't load the acutual map.
Sounds like you are doing the right things, I definitely needed to add the following rules to mobile-config.js
App.accessRule('*');
App.accessRule('https://*.googleapis.com/*');
App.accessRule('https://*.google.com/*');
App.accessRule('https://*.gstatic.com/*');
App.configurePlugin('plugin.google.maps', {
'API_KEY_FOR_IOS': 'your private key' });
Perhaps revisit google console to ensure you have set up both Javascript and IOS credentials correctly

Windows Store App (JavaScript) stopped displaying embedded web fonts

We use javascript/Angular inside our application and have a few different typefaces saved into a fonts folder within the project.
During a recent update the app stopped loading/displaying multiple fonts for no reason and with no alerts/errors.
The splash screen is taking considerably longer now as well so I assume it's related.
I reverted the code to before the edit and the issue persist.
I thought it may be visual studio so I upgraded to 2015, still has the problem.
I've done a ton of reading and I cant seem to figure out what would cause the webfonts not to load, hoping someone has some insights because I'm at a bit of a dead end.

Openlayers IE security issue

I'm working on a project that is using the OpenLayers ordinance survey for mapping and have been running into a very awkward issue. The issue only seems to live in Internet Explorer. The problem is as follows;
When loading the map, OpenLayers creates a dynamic .js file and inside this file there is a line of code that does the following :
setImgSrc:function(a){var b=this.imgDiv;b.style.visibility="hidden";b.style.opacity=0;a&&(this.crossOriginKeyword&&("data:"!==a.substr(0,5)?b.setAttribute("crossorigin",
this.crossOriginKeyword):b.removeAttribute("crossorigin")),b.src=a)}
The problem resides on the b.src=a line, everytime I run in IE ONLY I get a0x800c000e - JavaScript runtime error: A security problem occurred.
I've done research so far and having been turning up many leads, most of what I see is hosting images on your own server, but the resources are not available to accomplish this. If anyone can shed any kind of light on this issue it will be greatly appreciated.
Using Openlayers Version 2.12
Uh, provide some examples of 'a'?
Also, go to https://msdn.microsoft.com/en-us/library/ie/ms775145(v=vs.85).aspx , find INET_E_SECURITY_PROBLEM, and see if the errors codes shown look relevent. Eg. could it be a certificate error?

Categories