Local GeoJSON in Leaflet using leaflet-ajax My aim is to include a local geojson file in my Leaflet map application using  , as suggested by  earlier answer. In my root directory, I have:  index.html entire contents of  leaflet.ajax.min.js containing the contents of the source file on  bb4326.geojson containing 4 point features in EPSG4326  Index.html looks like: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt;     &lt;title&gt;Hey up here!&lt;/title&gt;     &lt;meta charset=&quot;utf-8&quot; /&gt;     &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;     &lt;link rel=&quot;shortcut icon&quot; type=&quot;image/x-icon&quot; href=&quot;docs/images/favicon.ico&quot; /&gt;     &lt;link rel=&quot;stylesheet&quot; href=&quot;https://unpkg.com/leaflet@1.7.1/dist/leaflet.css&quot; integrity=&quot;sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==&quot; crossorigin=&quot;&quot;/&gt;           &lt;script src=&quot;leaflet.js&quot;&gt;&lt;/script&gt;         &lt;script src=&quot;leaflet.ajax.min.js&quot;&gt;&lt;/script&gt;  &lt;/head&gt; &lt;body&gt;  &lt;div id=&quot;mapid&quot; style=&quot;width: 600px; height: 400px;&quot;&gt;&lt;/div&gt; &lt;script&gt;      var mymap = L.map('mapid', {center: [52.47, -1.89], zoom: 13});      L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {         maxZoom: 18,         attribution: 'Map data &amp;copy; &lt;a href=&quot;https://www.openstreetmap.org/copyright&quot;&gt;OpenStreetMap&lt;/a&gt; contributors, ' +             'Imagery © &lt;a href=&quot;https://www.mapbox.com/&quot;&gt;Mapbox&lt;/a&gt;',         id: 'mapbox/streets-v11',         tileSize: 512,         zoomOffset: -1     }).addTo(mymap);      var geojsonLayer = new L.GeoJSON.AJAX(&quot;bb4326.geojson&quot;);            geojsonLayer.addTo(mymap);  &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;  Opening index.html in a browser results in the basemap at the requested location and zoom-level, but the geojson file contents are not displayed. What am I overlooking? I thought that the ajax.min.js script ought to load the dataset for me? bb4326.geojson was created by exporting a Shapefile to GeoJSON in QGIS and looks like: { &quot;type&quot;: &quot;FeatureCollection&quot;, &quot;name&quot;: &quot;bb4326&quot;, &quot;crs&quot;: { &quot;type&quot;: &quot;name&quot;, &quot;properties&quot;: { &quot;name&quot;: &quot;urn:ogc:def:crs:OGC:1.3:CRS84&quot; } }, &quot;features&quot;: [ { &quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: { &quot;id&quot;: 1, &quot;cat&quot;: &quot;A&quot; }, &quot;geometry&quot;: { &quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [ -1.903211081088789, 52.483536707820782 ] } }, { &quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: { &quot;id&quot;: 2, &quot;cat&quot;: &quot;A&quot; }, &quot;geometry&quot;: { &quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [ -1.569431757803851, 55.041100936161001 ] } }, { &quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: { &quot;id&quot;: 3, &quot;cat&quot;: &quot;B&quot; }, &quot;geometry&quot;: { &quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [ -0.164490580870734, 51.446934150191545 ] } }, { &quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: { &quot;id&quot;: 4, &quot;cat&quot;: &quot;C&quot; }, &quot;geometry&quot;: { &quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [ -3.239562634800648, 51.514642158718445 ] } } ] }
GeoJSON does not appear on my Leaflet map I'm a beginner in Leaflet and I need help to deal with GeoJSON files.  I succeeded in creating a Leaflet basemap. I can add markers without troubles but I cannot manage to show a GeoJSON layer.  Here is the code I picked up from Leaflet Tutorials website  :  var geojsonFeature = {     "type": "Feature",     "properties": {         "name": "Coors Field",         "amenity": "Baseball Stadium",         "popupContent": "This is where the Rockies play!"     },     "geometry": {         "type": "Point",         "coordinates": [-104.99404, 39.75621]     } }; L.geoJSON(geojsonFeature).addTo(map);   Unfortunatly, the GeoJSON does not appear in my map.   Can you tell me where I missed something ?    Alright, you're fine Francisco, this part was OK. I changed the whole script and it works !  However, would you know how to load a GeoJSON from an external source ?  I tried this :   var geojsonLayer = new L.GeoJSON.AJAX("foo.geojson");        geojsonLayer.addTo(map);   from   but this definitely does not work.  Any ideas ?    I am not skilled enough to understand your advice.  Here is the whole code I am using to create my map :  &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;data&lt;/title&gt; &lt;meta charset="UTF-8"&gt; &lt;link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" /&gt; &lt;script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"&gt;&lt;/script&gt; &lt;script src="https://code.jquery.com/jquery-3.1.1.min.js"&gt;&lt;/script&gt;   &lt;script type="text/javascript" src="http://maps.stamen.com/js/tile.stamen.js?v1.3.0"&gt;&lt;/script&gt; &lt;script src="/js/leaflet-0.7.2/leaflet.ajax.min.js"&gt;&lt;/script&gt; &lt;script src="htdocs/webmap101/leaflet.ajax.min.js" type="text/javascript" &gt;&lt;/script&gt; &lt;style&gt;    #map {width: 960px; height:700px;} &lt;/style&gt; &lt;/head&gt; &lt;body&gt;   &lt;div id="map"&gt;&lt;/div&gt; &lt;script&gt;   // create map var lat = 44.933331; var lon = 4.9;  var map = L.map('map',{center: [lat,lon],zoom: 6});   // basemaps var base = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',   {attribution: '© &lt;a href="http://osm.org/copyright"&gt;OpenStreetMap&lt;/a&gt; contributors'  }); var toner = new L.StamenTileLayer("toner"); var watercolor = new L.StamenTileLayer("watercolor"); var landscape = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png'); base.addTo(map);   // markers  var mark1=L.marker([lat,lon]) mark1.addTo(map)    // layers panel  L.control.layers({"base": base, "water": watercolor, "toner": toner , "landscape" : landscape}).addTo(map);    // geojson files var geojsonFeature = {     "type": "Feature",     "properties": {         "name": "Coors Field",         "amenity": "Baseball Stadium",         "popupContent": "This is where the Rockies play!"     },     "geometry": {         "type": "Point",         "coordinates": [-104.99404, 39.75621]     } }; L.geoJSON(geojsonFeature).addTo(map);    //ajax  var geojsonLayer = new L.GeoJSON.AJAX("foo.geojson");        geojsonLayer.addTo(map);  &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;   I know it's a bit messy but this is actually my very first HTML script... I guess I did not include in a proper way the AJAX library.    Actually, I just want a solution to replace the lines where I create the GeoJSON by something that tells javascript to load the GeoJSON stored locally in my folder. This :  var geojsonFeature = {     "type": "Feature",     "properties": {         "name": "Coors Field",         "amenity": "Baseball Stadium",         "popupContent": "This is where the Rockies play!"     },     "geometry": {         "type": "Point",         "coordinates": [-104.99404, 39.75621]     } };   should be transformed into something like (I don't know if it exists) :  var geojsonFeature = [foo.geosjon]   where "foo.geosjson" is a file like :  { "type": "FeatureCollection", "name": "abies", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature"
How does Newtonian mechanics explain why orbiting objects do not fall to the object they are orbiting? How to shrink Windows 7 boot partition with unmovable files I have just bought an HP laptop with Windows&nbsp;7 (64 bit). It has a 500&nbsp;GB HDD with three partitions: a small hidden system partition, a 12&nbsp;GiB HP recovery partition, and a 450&nbsp;GiB C: boot partition.  I would like to split this large C: partition into two partitions, leaving only 100&nbsp;GiB for the system, and giving the rest to a new data partition.  Although the Windows built-in Disk Management utility has an option to shrink the bootable partition, it only allows me to shrink it roughly by half, even though only 20&nbsp;GiB on the partition is used. As far as I understand, system unmovable files lie in the middle of the partition, preventing Disk Management utility to do what I want.    And since new HP laptops don't come with OS installation disks (they only allow you to create recovery disks yourself), I can't just repartition HDD and then reinstall OS.  So, is there a way to shrink the C: bootable partition and preserve Windows&nbsp;7 working?  P.S.: I have tried to use the third-party  utility, and after shrinking the partition, Windows&nbsp;7 stopped booting, with a . System recovery didn't work, and I had to do factory recover. Since this is a long process, I would like to avoid doing it again :) So, please, suggest only proven solutions. I would like to customize ubuntu for a library, they only want to display a web browser with their site in full screen.  No address bar, no button user can only click the link on the page.  If library's staff enter admin user name and password they can change any settings in ubuntu.  Any suggestion or usefully link is much appreciated. How can I calculate the number of work days between two dates in SQL Server?   Monday to Friday and it must be T-SQL. Too many requests? I went to stackexchange.com and clicked on SO.  After a few minutes I got a message saying "We have detected too many requests from this IP.  If this is an error contact us."  That was the second SE page I tried to visit.  Second only to SE.com  I moved to another machine and it's working now.  The first machine usually works, I don't know if a got assigned a blacklisted IP or what.  Anyone know what's going on?  EDIT: I would really rather not post my IP on the web, but if a diamond or dev asks I'll email it.  EDIT 2: I looked at badp's dupe suggestion and can verify that I have no scripts frequently calling SO. Potential energy of an infinitesimal length of elastic rod I am using \tableofcontents to create TOC in my document. however it is appearing as shown in the image. As the numbers increase the gap between the number and text is reducing.   Thanks for your help Aku In my textbook it is given that      'The wave function describes the position and state of the electron and its square gives the probability density of electrons.'    Can someone give me a very simple example of a wave function with explanation?  (Note: This question is not a duplicate. I have searched for other questions of this type but the answers were overwhelmingly difficult to understand.) I understand why the Empire would want to start using more than one genetic template to create clone troopers, but why did it start using non-clone troopers instead of just continuing the cloning program?  It seems that with cloning they were able to use a training program (and genetic manipulation) that gave them completely loyalty (other than when the Kaminoan rebellion, where the Kaminoans had sabotaged the training programs).  Why stop using such troops and start using people that might question orders or aren't as easily controlled as clones were? How to hide "internal" polygon boundaries? On the Stack Overflow help center article about review queues, , it says on the bottom:  Note: These two queues do not exist on Meta sites.  But there are Late Answer and First Posts review queues on Meta Stack Overflow, as far as the  says. So shouldn't that last sentence be removed? What would happen to a star if a Dyson sphere lined with mirrors reflected a significant portion of the stars light back to the star I have looked for similar questions here on stack exchange. The closest example to this that I found is . That question assumed less than perfect absorption of material lining the inside of the sphere, and the effect of thermally re-radiating it inside the sphere.  A lot of the answers focused on that much of the thermal radiation would not be reflected back to the star, and is likely to be reabsorbed by the sphere at another location. On the other hand, this question asks what would happen if the Dyson sphere, using mirrors, deliberately refocus a significant portion of the rays directly back at the star. How to access the system tray using the keyboard? Is there a way I can access the system tray items using the keyboard in Windows XP? Shell script to send an alert mail if disk usage exceeds 90% Show that $xy=0$ is a variety but not a manifold In sysctl, the /proc/sys/net/ipv[46]/conf/ keys have the following subkeys: all, default, and a key for each network interface. For example, on a machine with a single network interface eth0, it will look like this:  iserv ~ # ll /proc/sys/net/ipv[46]/conf/ /proc/sys/net/ipv4/conf/: insgesamt 0 dr-xr-xr-x 0 root root 0 12. Sep 23:30 all/ dr-xr-xr-x 0 root root 0 12. Sep 23:30 default/ dr-xr-xr-x 0 root root 0 12. Sep 23:30 eth0/ dr-xr-xr-x 0 root root 0 12. Sep 23:30 lo/  /proc/sys/net/ipv6/conf/: insgesamt 0 dr-xr-xr-x 0 root root 0 12. Sep 23:30 all/ dr-xr-xr-x 0 root root 0 12. Sep 23:30 default/ dr-xr-xr-x 0 root root 0 12. Sep 23:30 eth0/ dr-xr-xr-x 0 root root 0 12. Sep 23:30 lo/   All the respective settings exist in each key separately. For example, if I want to disable IPv6 Router Advertisements with the accept_ra value, this value exists four times:  iserv ~ # sysctl -a 2&gt;/dev/null | grep "accept_ra " net.ipv6.conf.all.accept_ra = 1 net.ipv6.conf.default.accept_ra = 1 net.ipv6.conf.lo.accept_ra = 1 net.ipv6.conf.eth0.accept_ra = 1   My question now is: which of these values do I need to change? I figured all (to change all existing interfaces) and default (to change all new interfaces that may appear later), but changing these still leaves the value at 1 for lo and eth0:  iserv ~ # sysctl -w net.ipv6.conf.all.accept_ra=0 net.ipv6.conf.all.accept_ra = 0 iserv ~ # sysctl -w net.ipv6.conf.default.accept_ra=0 net.ipv6.conf.default.accept_ra = 0 iserv ~ # sysctl -a 2&gt;/dev/null | grep "accept_ra "   net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0 net.ipv6.conf.lo.accept_ra = 1 net.ipv6.conf.eth0.accept_ra = 1   Will the machine now accept Router Advertisements on eth0, or will it not? I define a shell keybinding in my ~/.bashrc like so:  bind -x '"\e\C-w":"/usr/bin/reset"'   This does make Ctrl-Alt-w launch the reset executable. However, it leaves the terminal in a state that resembles the one you get into by pressing Ctrl-v. So, for example, if immediately after resetting in this way I press Ctrl-p, instead of invoking the action of that shortcut (repeat previous command) I get ^P printed.  Any idea what's causing this problem and how to fix it?  EDIT: I am attaching a Python program that reproduces the messed-up terminal state I am trying to fix with the reset. I encounter this condition very often while debugging multi-threaded applications:  import pdb, thread, time  def interrupt():     time.sleep(2)     pdb.set_trace()  thread.start_new_thread(interrupt, ()) raw_input('? ')   To reproduce the messed-up state, just run the code above, and press Enter when you see the debugger invoked (it will print a bunch of text, ending with pdb.set_trace(), about two seconds after you run the program and the initial prompt appears). Do lens hoods need to be matched to focal length? Is it true that not all generic lens hoods work on all lenses (provided the filter diameter matches, of course)? I read that the focal length plays a role in it - but I cannot find such readings on any lens hoods I see available online. I am interested in setting up a Ruby on Rails environment on my 10.10 laptop.   Is there anything special I need to keep in mind for installation (i.e. that could be new or unique to 10.10)?   Are there any suggested walkthroughs that I could follow along with?  Thanks in advance. How to show this equality of $\rho(X,Y)$ Let I have $(S,\Sigma,\mu)$ be a probability space, then $X,Y \in \Sigma$. Define $\rho (X,Y)$ by $\rho (X,Y)$ = correlation between random variable $I_X$ and $I_Y$, where $I_X$ and $I_Y$ are the indicator function of $X$ and $Y$. Express $\rho (X,Y)$ in term of $\mu (X)$, $\mu (Y)$, $\mu(XY)$. Conclude that $\rho(X,Y)=0$, if and only if $X$ and $Y$ are independent.      How to show that: $$\rho(X,Y)= \frac{\mu(XY)\,\mu(X^cY^c)-\mu(XY^c)\,\mu(X^cY)}{(\mu(X) \,\mu(X^c)-\mu(Y) \,\mu(Y^c))^{1/2}};0&lt;\mu(X)&lt;1;\,0&lt;\mu(Y)&lt;1$$