Saved this one for thursday just in case it was too political. I wanted to see how much each state pays in taxes. Most data is on a per return basis. But other data that can be seen (by changing the pull down menu at the top) is:
Data and Tools:
Data on tax returns by state is from the IRS website in an excel format. The map was made using the leaflet open source mapping library. Data was compiled in excel and calculations made using javascript.
Here is a link to the original visualization: https://engaging-data.com/assembling-world/?cat=lifeexp
there are many other options in the visualization including sorting by population, population density, gdp, gdp per capita, country name, etc. . .
Data and tools: Data was downloaded primarily from Wikipedia:
Life expectancy from World Health Organization (2015)
The map was created with the help of the open source leaflet javascript mapping library
Hey everyone, author here! I made a proof of concept GPU-powered open source wind map that can animate up to a million particles with trails at 60fps in the browser, and described the process and the challenges in the article — hope you’ll find it useful!
The source is the GFS dataset from the US National Weather Service. The data samples are from Nov 2016, not updated hourly — hopefully that’s enough for a proof of concept. All the code for the visualization is on GitHub. I’m also the author of the popular Leaflet mapping library, and may try making a generic Leaflet plugin based on this code in future. Any questions are welcome!
Here is an animated gif of the visualization for those on mobile:
there are many other options in the visualization including sorting by population, population density, gdp, life expectancy, country name, etc. . .
Data and tools: Data was downloaded primarily from Wikipedia:
GDP data from the United Nations (2017)
The map was created with the help of the open source leaflet javascript mapping library
You can use Leaflet as is, loading the assets via CDN. Or if you prefer to use the asset pipeline and have custom helpers, there's also leaflet-rails.
You don't necessarily have to know much about web development to produce online interactive maps. For example, Esri has the WebApp builder and Mapbox has Mapbox Studio.
If you want to make custom interfaces, I would start by learning some basic HTML and CSS. Then learn JavaScript, which is what makes websites interactive. Besides the commercial products and APIs (Google, Esri, Mapbox...) there's many open source and free libraries like leaflet and openlayers.
All of these libraries have tutorials and examples which can help you get started.
I have recently implemented a zoom able map using Leaflet. Almost 90 thousand images for 9 levels of zoom and that's just to cover a decent sized island.
I could do a write up but it gets a bit technical.
The most obvious alternative is QGIS, an open source desktop application very similar to ArcGIS Desktop. (http://www.qgis.org/). It has versions of the most popular geoprocessing tools available in Arc, and is always growing and getting better.
For web mapping, there are a number of alternative Javascript libraries that you can slam together to get the functionality of ArcGIS Online or something similar. Check out Leaflet (http://leafletjs.com/).
After looking around a bit, I couldn't find a way to get the whole largest images from a single url. On the site itself, they are served in pieces, and loaded and tiled with a map lib called Leaflet.
But if you are feeling adventurous, getting the pieces and reassembling them Is not impossible. Here's some hints on that:
Each tile is located at a URL of the form http://quod.lib.umich.edu/cgi/i/image/api/tile/{c}/{entryid}/{viewid}/{z}-{x}-{y}.jpg
.
{c}
seems to always be "lbc2ic".{entryid}
is the id of the image.{viewid}
doesn't seem to be interpreted by the server. The site sets it to values like "SCLP_0001" - similar to the entry ID.{z}
denotes the zoom level. Use 0 for the maximum one (original image size).{x}
and {y}
are integers, representing an offset of 256 px per unit (with (0, 0) being the top-left corner).The api serves empty files for x, y, and z values that are too large to make sense.
Mapbox recently moved into new offices in both SF and DC, maybe they have different chairs now — will check it out on my next trip there. :) We have a few dozen remotes but they're more of an exception (e.g. substantial contributors to the mapping industry that can't relocate). Personally I got hired 4 years ago after creating Leaflet, an incredibly popular JavaScript library.
You can't split a leaflet map, the way to achieve this is to load the country boundaries as a separate layer on top of the map image.
This method is likely to require some GIS knowledge so you can geo-reference the image to the boundary data.
Bosola's SVG idea is a simpler option and unless you have a particular desire to learn about web mapping and GIS (I'd recommend it if you have the time), it's probably the best one to go with.
Leaflet or OpenLayers will be your best bet, the task will be fairly straight forward with either of those, and you can use an OSM basemap.
Here are the leaflet docs: http://leafletjs.com/reference.html
I've been messing with Leaflet a lot recently, and I decided it'd be fun to remake this with a map-based interface. Obviously, I still need to add many more restaurants.
The "killer feature" that I would like to implement once I have enough data is an Indecision Button. You click "where should I eat?", and it randomly chooses a restaurant near you. The trick is, it probably shouldn't recommend coffee shops or U-go's, and I'm not sure how to draw the line regarding bars.
Edit: No need for me to store data for bars; we have this
This is so awesome! Thanks /u/TheLazyAdministrator for putting this together. I LOVE seeing dashboards built on tech that I have never even used.
I hope to keep improving this product and I really want to make it easier to use. Your post really helps put that in perspective.
I know UD has a learning curve right now and want to make that easier. I'm going to be releasing a whole bunch of new controls in the 1.6.0 release that are built on New-UDElement that should make some of the basic GUI components easier to include in your projects. It should also serve as an example for new components the community may want to build. I'm even moving some of the current controls (Row\Column\Table) into the open source repo.
These components are all on GitHub but will be packaged into the next UD release: https://github.com/ironmansoftware/ud-controls
I also plan to make it easier to create UIs that can take user input to adjust the graphs based on options that users select.
If you're ever looking for examples or run into an issue or have a suggestion on a feature, please let me know via my GitHub repo here: https://github.com/ironmansoftware/universal-dashboard
Thanks again for sharing this will everyone! If you have any suggestions on ways I can help you or others be successful with UD, let me know.
P.S. Would anyone be interested in a map library in UD? http://leafletjs.com/
Looks like this is a pretty custom implementation for the most part. What was the reasoning behind not using existing mapping tools and libraries? For example tilestache for a tile server and openlayers or leaflet for the client?
Here is the link to the webpage where you can look at other country statistics in the same manner.
there are many other options in the visualization including sorting by population, population density, gdp per capita, life expectancy, country name, etc. . .
Data and tools: Data was downloaded primarily from Wikipedia:
GDP data from the United Nations (2017)
The map was created with the help of the open source leaflet javascript mapping library
Data comes from the US Department of Transportation’s National Household Travel Survey (NHTS). That data was processed to identify vehicle characteristics by state and plotted using javascript and the open-source leaflet map library.
I know California is home to about 50% of EVs in the United States, but I was curious as to how many vehicles were in other states, especially the ones that you wouldn't think would have many (Alaska, Wyoming, etc.). Now I know. Hopefully you'll find it interesting too.
Data and Tools: Data on electric vehicle sales is from the Auto Alliance website. Licensed driver data was downloaded from the US Department of Transportation’s Bureau of Transportation Statistics website. The map was made using the leaflet open source mapping library. Data was compiled and calculated using javascript.
> What software is normally used? Most professional mapping shops will use ESRI's ArcGIS suite of products. There is also QGIS which is a very nice and well featured opensource alternative. If you start looking at interactive mapping and hosting it on a webpage, there are plenty of javascript mapping extensions, but leaflet is probably the easiest to learn (in my opinion).
> What programming languages can best perform these kinds of tasks? If you are looking at just taking data and putting it on the map, you don't really need to know anything programming related. If you start moving into the interactive side of things, having a grasp of javascript and html by extension would do you good. If you go even further and start looking into data manipulation and scraping, python is your best bet, though I would say that R is a good tool too. You can go pretty far with python and javascript. ESRI also has ArcGIS Online, which is pretty nice, but if you're just learning or trying to have some mapping related fun, it might not be for you. Try github pages for some easy hosting plus code storage.
>And are there any examples people could provide? http://leafletjs.com/examples.html actual conflict map built using leaflet: http://isis.liveuamap.com
> Is this something a beginner could do?
a beginner can do everything. Thats how you stop being a beginner. But it does require you to be willing to learn. Otherwise you pay someone for it
In theory yes. The best way to do this is probably web based (with javascript) because all the map frameworks work like that anyways. If you need this in a normal program or mobile app you could then go ahead and include it as a web view or something similar
starting points would e.g. be google maps customization, leaflet (http://leafletjs.com/) or openlayers (https://openlayers.org/). I personally have only tried openlayers and it seems to be the most extensive one. Can be good or bad, examples at https://openlayers.org/en/latest/examples/
Pretty amazing library in how it works, that pipe syntax really does the job well.
Checkout LeafletJS for map-containers also. More your standard type features for dealing with presentation of maps, points, lines and such (even MapServers, TileCache etc). Compared to D3JS where it's just some projections to help you out.
I haven't made the code public on github yet.
But: This is entirely a static site, so the code is all available in the various javascript files if you wanted to take a look. The spawn locations are pulled from S3 via APIGateway.
If you are interested in making a map like this, I highly recommend checking out Leaflet.js which is what I used to make the map.
Also a GREAT resource (that was heavily borrowed from) is the Witcher 3 Map. The source code for that map is available on github.
I don't know how to do this in AGOL off the top of my head. If I instead pretend you asked for help with Leaflet I can answer this question...
Add your features (as in the documentation) and then, so for your point layer...
markers.bindPopup("this is some content"); markers.on('mouseover', function (e) {this.openPopup()}); markers.on('mouseout', function (e) {this.closePopup()});
Yes. I'm a big OpenStreetMap enthusiast, and I've just commented offering to help. It would be good PR for the volunteer-driven OpenStreetMap project. And it would be a nice happy ending to this story, to see him make the switch to OpenStreetMap technologies.
The way to do this, would be to swap out the map display for http://leafletjs.com (so it’s this API we’d be working with for click handling, marker plotting, line drawing, etc. Certain amount of rewriting of the site logic) With this we’ve got a choice of base map tile server, such as the free one from “mapquest open”, or the nice plain “CartoDB positron”. And for the route calculations, the equivalent API is called http://project-osrm.org OpenStreetMap doesn’t have a glossy “product set” in the same way that google maps does. It has free open geo-data, and range of 3rd parties providing these kinds of APIs.
We used Leaflet.js to create the map application and Tilemill and Mapbox Studio for the map tiles. The data is from the city Berlin.
How many markers are we talking about? Is it currently in shapefile format? Will it be continually updated?
If these points are static, I would recommend using the Leaflet API with custom marker symbols. See the tutorial here: http://leafletjs.com/examples/custom-icons.html
If the points are going to be edited a lot, and continually updated, I would suggest putting it in a PostGIS database that hooks in with Geoserver. You would install PostgreSQL and PostGIS on top of that as an extension. Install Geoserver and register the PostGIS instance as a data store. Load the data into PostGIS and use QGIS to edit the points. The changes will automatically be synced up with Geoserver and delivered to your Leaflet map.
(these are all free/open source options)
Let me know if you have specific questions. I just went through this process.
I'd recommend learning Leaflet. It's easy and flexible. http://leafletjs.com/
Google Maps API is pretty easy to learn too, once you have basic HTML/Javascript concepts down.
EDIT: Java =/= JavaScript. You want javaSCRIPT.
I tried playing with http://leafletjs.com/ ; with this library if you know a tiny bit of JS you can get started with OpenStreetMap maps in a couple of hours.
For a mobile app, both Google and Apple (and I guess also Microsoft) have pretty thorough mobile SDKs.
You can also do this with Leaflet. Leaflet is what MapBox uses, it's open source, light, easy and nice. There are two plugins you can use, I'd just use omnivore, which is written by mapbox, I think. It reads all kinds of local files.
Regarding interactive teasers, you can definitely do this with Leaflet. Give it a go!
Links follow:
Check out leafletjs for mapping. It uses OSM tiles, so I've found it to be faster to load than gmaps on a mobile internet connection even with online tiles.
You can also download an area/depth of OSM tiles with JTileDownloader and point leaflet at these on the local disk, for true offline mapping.
I would recommend learning web mapping and Javascript using an open source API like leaflet. They are certainly not as powerful as Arc JS, but are much easier to grasp.
Here's a good place to start: http://leafletjs.com/examples/quick-start.html
Could you possible use D3.js or Leaflet? Both very easy to create interactive maps with.
The pic is just for international airports. You can include LaGuardia for domestic flights in the interactive version below.
The interactive version.
Data source: Taxi trip data from the NYC Taxi & Limousine Commission
Tools used: Analysis done in R, map made using Leaflet
How specific are you looking for?
What level of web development are in? Do you make basic ArcOnline maps? Do you download Bootstrap templates and modify a Google Maps API into them? Do you truly understand Object Oriented Programming? What about Functional Programming? Do you understand how to build an API? Can you build the API in an elegant manner? Can this API be used anywhere by anywhere, scale, and interact with a variety of programs?
Did you look up Agafonkin or Leaflet?
Go to features and read all of them. GIS staff typically don't know how to do all that.
If this still doesn't make sense, sign up for a fundamentals of programming course.
Well, Vladimir already described the map making process here: http://leafletjs.com/examples/choropleth/
but with QGIS2web you'll get the basis quite handy and you jsut need to write an own geojson.on("hover") function...
> what sorts of programming language(s)
JavaScript/HTML/CSS & probably some mapping library like Leaflet or OpenLayers
If you can pre-compute the routes in QGIS and export those to geojson, then you can probably do what you described where the user clicks on some nodes, then you apply a query on the graph to show that specific route. That solution will probably not scale very well. If your dataset is rather small, it will probably be fine, but if you have lots of nodes and routes it probably will result in slow load/interaction times.
You could look into using a routing service from a server/database such as pgrouting. That would require a lot more overhead though.
Interactive to me suggests you should be building something weblike with html & js. For interactive maps, start with leafletjs: http://leafletjs.com/
Quick, easy and loads of people use it so there's lots of help about.
It's been awhile since I worked with Leaflet, but from a look at the Leaflet and Easybutton docs and my understanding of your requirement, I'm thinking you'd want something like this:
L.easyButton('fa-pencil', (button, map) => { toggleLayer({ layer, map }) })
Where you define a toggleLayer
function that uses hasLayer to determine whether to invoke addLayer
or removeLayer
on your map.
Sure, no problem. The code for "style.display" is just a styling property for the element and is boiler plate native JS, "none" = not visible essentially and "block" is a styling method that shows the div. This code was just for illustration on how to add a listener. Here's an example site that shows specifically how to work with Leaflet: http://danielmontague.com/projects/easyButton.js/v1/examples/ Here's also more sample code on how to add the layers: http://leafletjs.com/examples/layers-control.html
It's not that hard if you have the polygon data to define your regions. Check out some of the leaflet examples.
Web based mapping breaks down into vector (shown above) where you can have the polygon defined and manipulated in the browser, and raster where it's defined as the background tile layer - see mapbox for a good example of what you can do with tiles.
You can mix both together and come up with some very compelling spatial applications.
For JavaScript you have:
Leaflet http://leafletjs.com
Or
Openlayers http://openlayers.org
Both are front end libraries. Leaflet is focussed on minalism with plugins adding functionality, which might be a good place to start. Openlayers is more fully functional out of the box.
For Java there is GeoServer, which is probably the most popular open source web map server.
You can find a large list of projects at OSGeo: http://www.osgeo.org
Your suggestions are all very fitting and together form the foundation for endless products in the browser. You should find QGis useful for visualizing the data and perhaps editing on the tables if you'd prefer a desktop application over table manipulation via PostgreSQL. Once happy with the data postgis can consume the table by importing either shp or csv from QGis output. Once inside a postgis enabled database can connect to geoserver to serve as proxy between client and Postgres. Geoserver produces a wfs url available in a variety of forms including geojson to be consumed by mapping APIs such as leaflet.js. Plenty of other client side options as well depending on your goals. Perhaps geonode might be of useful? Anyway don't know your level of familiarity with any of the above but this should help formulate a road map?
Check out the following:
Once a map is done, it can used to annotate, mark, and do all kinds of things for interaction. The tiling function with zoom levels works too, but you will need to create each of the zoom levels as well. This could be done with layers in the drawing software. Do the whole thing, and then turn off the detail layers for export as the first zoom level, turn on finer detail layers for the next zoom level export, and then even more details for the next zoom level export, etc.
Tiling software will come in handy at this point....
Hey, finally something I can help with on here! (GIS developer)
I'm going to give some basic details and let you ask questions that you need answered.
The JSON file you have draws polygons for some UK boundaries by the looks of it.
The arcs you see are coordinate pairs that connect together as lines that form a single polygon (boundary).
The reason your coordinate pairs are larger is because they either use a different coordinate system or they are placed differently in the world.
I could talk your ear off for hours on coordinate systems but let's not do that until we get some questions answered.
Questions for you:
1) What area are you trying to map?
2) How are you getting/generating the JSON?
3) What are you trying to accomplish?
4) Are you using any other data sources? - You should make sure the projections match.
Hope that gets you started!
Edit - BTW, I looked further into this and it seems like major overkill to make a basic web map. Look into something easier like Leaflet.
It sounds to me like you're looking for some sort of interactive browser-based application that will let you click on different polygons on a map and display some aggregate of their attributes as a popup or something like that. Is that right? In a few minutes Googling, I couldn't find any examples of what I'm thinking that you're thinking, but I would start by looking at leaflet, a javascript package for interactive maps. Here is an example of a simple state map that displays population density when you click on a state (one at a time in this case). You may be able to extend this to aggregate multiple selections and display the sum of the populations, although I haven't tried such a thing myself in leaflet. Good luck!
For mapping you are going to need to use a javascript library. I would recommend using Leaflet. It has a very clean api, nice documentation, and should be fairly simple to incorporate with your django views.
This leaflet tutorial does exactly what you want: geojson -> styled choropleth. http://leafletjs.com/examples/choropleth.html
In that example the geojson stored in a .js file and given a variable name, so not ideal as needs some extra steps after converting with GDAL. There are better ways to just load a standard .geojson file which you can read about here: http://lyzidiamond.com/posts/external-geojson-and-leaflet-the-other-way/
If you go this route you can export your final shapefile as json. You can then consume this pretty easily with Leaflet. This assuming that you don't need it to update on it's own or anything like that.
Aha I found the bit of code that does it
function zoomToFeature(e) { map.fitBounds(e.target.getBounds()); };
Here's a link to the tutorial I followed
I have done this a couple of times with
The way I did it is I had two layers, the Leaflet-Draw layer (where everything is editable) and the actual data layer. When users clicked on a data-layer shape, they'd get a pop up asking if they wanted to edit it. If they did, I'd move the shape to the Leaflet-Draw layer. Clicking a shape in the Leaflet-Draw layer would show a dialog asking if they wanted to save.
When they saved the shape would be sent via WFS-T to GeoServer which stored the shape in the database. Upon a successful response from GeoServer the shape is copied from the Leaflet-Draw layer back to the data layer and is no longer in edit mode.
Creating shapes was basically the same, except they used the Leaflet-Draw tools to initialize a shape.
There was more going on since we were saving a bunch of properties and doing validation and stuff too, but that's the gist of it.
I expect that the Esri tools have similar capabilities, but I haven't used them.
Sounds like you're misusing the Layer Control, don't swap basemaps and overlays. Check that you're using LayerGroup correctly as it will only render one checkbox with the label you choose for an array of layers you designate.
If you really only want to render one layer group at a time, either:
It'll help if you post a code sample. Check out https://gist.github.com/ or https://jsfiddle.net/ to post live examples.
Also You should probably post this to www.gis.stackexchange.com or www.stackoverflow.com if you haven't already.
Remember D3JS has projections, so you can use real coordinate systems rather than pixel locations.
Also this is worth a look for map code itself. http://leafletjs.com/
I'm guessing you're a little new, so this might be a really big task. Well, regardless, you'd be matching each user_id to a time, each time frame for that user to a X,Y position, and you'd allow that page to transition the time frame, thereby transitioning the X,Y. Just hit F12 or Ctrl+Shift+i and look at the resources and page layout. WGET could copy the site.
http://leafletjs.com/ http://stats.wogames.info/js/replay.js http://stats.wogames.info/js/bzip2.js
Unfortunately, the more sensible way to do what you want involves Javascript, not Python. Javascript is not too hard, but a little bit trickier than Python.
Basically, you want to make a website.
There are tons of open and free libraries to make maps like this one of yours, my personal favorite is http://leafletjs.com/ (there are also tons of plugins for leaflet to add fancy markers to the map...)
depending on your needs and skills, throwing up a simple web map can be really easy. http://leafletjs.com/examples/choropleth.html
you'd just need to structure your data as GeoJSON, which should not be hard to do, especially with a tool like QGIS. I think the manual drawing solution is fine if you don't care about updating the data or testing multiple styles. Otherwise you'll benefit from using QGIS.
That should definitely work; however, just know that mongodb accepts WGS84 and does not work with projected coordinated points (e.g. UTM) to my knowledge. This means that you'll have to work in Lat/Long and calculations over large areas might return weird results (because of the curvature of the earth).
You might want to also consider using leaflet to display the information. You could use it to display and interact with objects. Just don't use a background map and insert some sort of image overlay.
You can install the OpenGeo Suite for free on Ubuntu really easy. Here's their doco: http://suite.opengeo.org/4.1/installation/ubuntu/install.html
I stuck my DigitalOcean referral in another post above, and with a very basic DO instance and the OGS, you can have a pretty reasonable GIS server for around $60 per year. Note that I much prefer http://leafletjs.com/ over OpenLayers, once you start making maps. GeoServer is a fantastic backend.
Doesn't really give separate routes but here's a gigantic mapping of the routes: https://github.com/PasDeChocolat/LiveBus/blob/master/public/data/bus_topo.json
Github maps it out automatically, to map it yourself you'd have to use another mapping tool. I'd recommend Leaflet: http://leafletjs.com/
Nice, I made this: http://edinburgh.io/pubs/
EDIT: You might want to checkout leaflet.js, which would allow you to switch map-provider, and hopefully fix your missing-street issue.
When we last spoke about this you said:
> Found npm that doing all for me, thx!
So now it seems that you're reporting a bug in the npm here?! Why do you think that this is a Leaflet problem?
But if you do believe the problem lies with Leaflet then can you give us an example of the relevant bit of code failing using Leaflet Plunker.
If you have suggestions for other stats, let me know and I can add them to the tool.
Data and tools:
Data was downloaded from : GDP https://www.bea.gov/data/gdp/gdp-state
The map was created using HTML/CSS/javascript and the help of the open source leaflet javascript mapping library
Saw Bo's map so I thought I'd add my own that I'd previously made. A different take on the "Impeach this" map that's been circulating around.
I always thought that the electoral maps were inaccurate because many of the red states have large areas but not alot of electoral votes. So I decided to change the sizes of the states so that their area is proportional to the number of electoral votes and give a more accurate visual picture of red vs blue.
Data and Tools
Data on electoral votes is from Wikipedia. The map was made using the leaflet open source mapping library. Data was compiled and calculations on resizing states were made using javascript.
<strong>Data Sources and Tools:</strong> This map projection is an equirectangular projection. Data on population density comes from NASA's Socioeconomic Data and Applications Center (SEDAC) site and is displayed at the 1 degree resolution. This interactive visualization is made using the awesome leaflet.js javascript library.
I wanted to look at the geographic distribution of electric vehicle (EV) sales and California has a good bit of data on EV sales by zipcode. This map looks at the "hot spots" of EV sales in the state with the most EVs in the US.
Data and Tools:
Data is obtained from the California Clean Vehicle Rebate Program (CA CVRP). The data is downloaded and aggregated in MS Excel and the map is made using javascript and the leaflet.js library
Which features were you going to be leveraging?
I recognize you'd have to rewrite your code but there are others, which might help you off the ground? Or Mapstraction might give you the opportunity to switch between Map suppliers?
Such as: Bing OpenStreetMap http://mapstraction.com/ http://leafletjs.com/
Pretty cool! * Personally I like to use the noWrap option to prevent the duplicate world maps. * I get errors in the console when I move the mouse into a highlighted country without choosing a city. Uncaught ReferenceError: info is not defined at e.highlightFeature (index.php?showmap=1&people=4&networth=500000&wr=4:387) at e.fire (leaflet.js:1) at e._fireDOMEvent (leaflet.js:2) at e._fireEvent (leaflet.js:4) at e._handleMouseHover (leaflet.js:4) at e._onMouseMove (leaflet.js:4) at e.s (leaflet.js:1) at HTMLCanvasElement.r (leaflet.js:1)
I'd need to know a bit more about what kind of tools you're comfortable with to give a better recommendation, but if you're comfortable with JavaScript then Mapbox is a nice alternative. It's built on top of Leaflet, which itself is a response to the more-complicated OpenLayers.
/u/jacobiwan_kenobi : I've made a very quick test with Leaflet and it seems quite easy to use. I've followed the tutorial about the space map and I have a working zoomable fantasy map. It's pretty basic and reading the doc might be required for more advanced features but you can quickly try the following on your side. Here is my HTML code (pretty simple):
<!doctype html> <html> <head> <title>Map test</title> <style type="text/css"> html, body { height: 100%; margin: 0; padding: 0; } #map { height: 100%; } </style> <link rel="stylesheet" href="js/leaflet/leaflet.css" type="text/css"/> <script type="text/javascript" src="js/leaflet/leaflet.js"> </script> </head> <body> <div id="map"></div> <script type="text/javascript"> var map = L.map('map', { crs: L.CRS.Simple, minZoom: -2 }); var bounds = [[0,0], [4069,5763]]; var image = L.imageOverlay('img/fantasy_map.jpg', bounds).addTo(map); map.fitBounds(bounds); </script> </body> </html>
The map picture is the fantasy_map.jpg in the img subdir, 4069,5763 (bounds) are its size in pixels (in the order height,width), I've put the leaflet dir (with the .css and .js) in a js subdir and the rest is pretty straightforward. The map object replaces the div with the id "map".
leaflet is a javascript library to display openstreetmap.
I would store the details in plain html, or if you want to have a little more structure, store it in json and do all the work in javascript
Ok, that's expected without something like ?service=wms&version=1.3.0&request=GetCapabilities at the end of the URL.
The problem looks like it may be that you're not setting the WMS version in the Leaflet options. Your Geoserver is using WMS v 1.3 but Leaflet defaults to 1.1.1.
I'm using leaflet for this, here is a quick start: http://leafletjs.com/examples/quick-start/
EDIT: you don't need to integrate, that's why you aren't finding anything, what you can usually do here, is to use django's templating system to inject your database data into javascript.
Let's say that you are following the leaflet example, change this line:
var marker = L.marker([51.5, -0.09]).addTo(mymap);
to something like this:
{% for store in stores %} var marker = L.marker([{{store.position.lat}}, {{store.position.lng}}]).addTo(mymap); {% endfor %}
of course this javascript should be processed by django, so you should add it to your .html file.
Another solution, if your data changes on real time, is to connect via ajax and load that data, but that is a little more complex.
Leaflet allows you to be pretty flexible in what to show, but is a bit hard to configure. Requires some knowledge of HTML and JavaScript.
For example a popular plugin for leaflet will allow you to show images on the map: http://blog.mastermaps.com/2014/08/showing-geotagged-photos-on-leaflet-map.html
With a bit of tweaking you can get something like:
Something to do with: http://leafletjs.com/ and here's another interesting thread: https://www.reddit.com/r/pokemongo/comments/4tw6uv/yet_another_pokemon_map_finder_pokeviewer/
No idea how to do this stuff but would love to have one of these for nodnoL
> guide or something? Maybe a video? Here is a guide on how to get started with leafletJs (the map framework): http://leafletjs.com/examples/quick-start/ To add a single custom image you need to add an imageOverlay (http://leafletjs.com/reference-1.0.0.html#imageoverlay) instead of a tileLayer shown in the quick start tutorial. ImageOverlay adds a single image on the map, while tileLayer allows the partial loading of smaller images (like in loremaps, but it is harder to create one). Does this makes sense?
leaflet.js could be an option and fits both points. if you wanted further filtering/functionality you could consider a leaflet.js/dc.js combination
Look at the docs for hasLayer
-- it takes an Ilayer as a param. Is the classes
variable that you're passing in an Ilayer
object?
Also please provide the console error, if any, when you have an issue like your map failing to load.
If you want to maintain detail and have it zoomable, you're going to need to break the pages into a ton of square tiles, each available at a variety of magnifications, just like they do for map sites. In fact you can probably use an open source tile viewer (e.g. Leaflet) as the base of your web site. That part is already written for you; the hard part is going to be making the tiles.
You can probably whip something up in not much time using existing open source tools. Use Ghostscript to convert each PDF page to a gigantic PNG image at various DPI levels, and then use ImageMagick to slice up each image into square tiles. You'll need to take care to use whatever file naming scheme your tile viewer expects.
Edit: another option would be to just use a PDF viewer written in JS like pdf.js.
Yeah, you will learn all three somewhat simultaneously. If you start with the HTML5/CSS classes first, they will most likely introduce incorporating js etc. Which will be a nice segway into JS development.
Don't get spun up on "using ESRI's Javascript API". Once you get the basics down, the world is your oyster when it comes to mapping libraries. If I were you, I would start by building a simple mapping webpage using leaflet.js. http://leafletjs.com/
(I haven't worked with the Google Maps API for quite a while now, so I am not up to date on what it can do, so take the following lines with a grain of salt)
I would suggest that you use libraries like OpenLayers and Leaflet instead of the Google Maps API. They are quite similar and offer pretty much the same features, but with those two it is possible to get the underlying maps from different sources (Google, OpenStreetMap, ...) and combine them into one. The users can then decide which one they want to use (Example of layer switching, here only between two different OSM styles).
But again, I could be wrong and this is something that is by now also possible with Google Maps.
You might try leaflet and the plugin for WMTS. There are lots of plugins on the leaflet site listed! http://leafletjs.com/plugins.html
You could look at the source of http://leaflet.melard.fr/ -- It looks like it is using exactly that setup.
Look at using leaflet; it has support for dropping pins, lines, etc it's all client side and very easy. The other big benefit is you can use any maps service you want and the full API will still work. Otherwise I think you're definitely going towards the right direction.
The ageing index of NUTS 3 and similar level regions in the Balkan Peninsula. The data comes from the lates censuses (2011) conducted in countires in question. The ageing index was calculated as a ratio of people older older than 65 and those that are younger than 15.
The interactive map was made using qgis and leaflet combo. Here's the static version of the map
Hi! thank you for the response. Currently I'm looking at using Meteor, so I will be using JavaScript and then MongoDB for the database structure. I personally haven't done this part of the research much, my brother has.
Does leaflet actually not support a touch event? On the documentation page it has a section on touch events (http://leafletjs.com/reference.html, search "touch")
Decided on using Gimp to cut up a map into tiles and then use leafletjs to stitch the tiles together with markers that can be placed from clicking.
Thanks again for your help!
If not with Google Maps, you can achieve this with Leaflet.js as well (here's an example of mine).
It looks great, some ideas to make stuff like this easier in the future
I think you are well on your way to success.
One thing to check first is the projection of the shapefile before you convert it to JSON. Did you do that? What projection is it? You might want to reproject it to Web Mercator (Aux Sphere) - the typical web map projection - before converting to JSON.
You already have your GeoJSON so I'd suggest you look at this sample.
Let me know when/if you get stuck. :)
Thanks so much for your response! Yay! The area I'm trying to map is in the USA which is probably why the coordinates are so different. I am generating the JSON using this kind of code from the tutorial: ogr2ogr \ -f GeoJSON \ -where "ADM0_A3 IN ('GBR', 'IRL')" \ subunits.json \ ne_10m_admin_0_map_subunits.shp
(But I am changing the .shp file to the other USA city one and cutting out the -where statement) I am eventually trying to make a map that will be a kind of interactive choropleth. I am using another data source but not another map -- I will match the two based on the 'id' charactersitic. I'm looking at Leaflet particularly this tutorial: http://leafletjs.com/examples/choropleth.html
...but I need to figure out how to use my shapefiles for it.
Thank you again for responding! I am digging in :)
EDIT: clarifying the ogr2ogr
Great questions! I've done a lot of work in the past with OSM, and really enjoy it. If, for no other reason, the flexibility you get in how your maps look. With this site, I went with a free tileset from Mapbox. I chose this specific one because I wanted to draw attention away from the map itself and keep it focused on what's actually going on. Check out http://mapbox.com. They charge for their services, but they have an entire "studio" where you can customize your map tiles in pretty much every way imaginable. If that's something that interests you or is important to you, I definitely recommend going the OSM way. Also, with Leaflet, it is incredibly easy to get your map going.
I included the bootstrap stuff, I guess, because I anticipate needing it eventually. As the app grows, I may want to allow users to subscribe to alerts or view analytics about crime in their area as seen by my app. This will require more than just the map that's there now, so eventually I'll probably need to lay some pages out with Bootstrap. However, you're right, currently I am not using it in any way.
Depending on your goal, I find the most popular choices for starting portfolio type work are:
ArcGIS Online - I find this to be a popular choice because it is free non-commercially for most small-medium projects and requires little to no scripting knowledge. You get some very clean templates and it works on mobile (as far as I have seen). However, it requires (for your purposes) to be hosted on their cloud and for you to have a login.
The real appeal to ArcGIS Online is the WebApps, once you make a map you can throw it into a WebApp (again without scripting experience). These apps can be quite powerful, albeit they generally look like "stock" ArcStuff.
Leaflet - Free and far more powerful, and it seems to be just as easy as messing with Google maps (to me). Scripting will likely be required however. Nothing too nerd-like, but you can't just drag&drop stuff everywhere. If you were interested in creating an App-like interface, you'll have to get a bit more in the weeds. I would recommend checking this out, at least, either way.
I imagine you would rather go with ArcGIS Online (at least to get started), although cloud storage can be a hindrance to people that need to hold on to their stuff, it would work out well for you since it would mostly be for a portfolio/resume. The ease of it is nearly unbeatable. I find that WebApps can be impressive, but are never "blow-you-away" stuff.
Hope this helps!
Noise data (LAeq, 16h in decibels) sourced from data.gov.uk, using Leaflet JS. Sound generated from a Trafalgar Square mp3 file available from freeSFX using the HTML 5 audio component.
Auch eine Beschäftigung. Also wenn hiefür eine Partei gegen den Vorteilen einer Gemeinde mit der Inhaftierten Rumänischer oder nicht allzuviel zu mehr online. Die FPÖ entgegnet dem Zweck vorgenommen wird, dann halt doch Österreich sind werden von anderen Meinung, als Kassenleistung zu wählen - diese dummen Unterdrückungs- und zu informieren. Ich bin seit das noch zwei. Den Frauen attraktiv sind. Bullshit. Schreib mir neu. Tolle Sache. Finde es etwas leichtes einfaches zur Sicherheit. Habe die Aktion bei jedem Wahlergebnis schockiert und schon des schnelleren Familiennachzugs, für alle normalen Einwohner. Sie nutzen http://here.com sowie: http://leafletjs.com/
Thanks for that! I don't plan to host it myself. Initially, since it'll just be a static graphic, I can pretty much use it as a jpeg on my existing blog. Once I make the step to make it interactive, it might be a different story - but maybe by then, I'll actually host my own blog.
I'll look at OpenLayers & boundless geo but I'll have to spend some time to come to grips with javascript and understand how to connect an api etc. What do you think of Leaflet? It seems similar to OpenLayers.
Leaflet JS and Mapbox based graphic. Data sourced from Wikipedia and then manually for each player's home club location.
UK railway crossings visualised to promote the use of open data in safety awareness. Data sourced from Network Rail, visualised using d3 libraries and Leaflet.
Visual of all railway crossings in the UK - helping to promote safety using open data. Data source is from Network Rail, visualised using Leaflet and d3 libraries.
Thanks for your reply. The "statesData" line of code was just put there to be assigned later to the census data inside the GeoJSON, it has no use at the moment.
So if i'm understanding correctly, the geometry does NOT show up in the code itself, only in the GeoJSON file itself once I initiate this layer?
L.geoJson(statesData,{}).addTo(map);
This geoJSON file from the tutorial is what I was expecting, but with better formatting. What threw me off was that it shows the Geometry with its respective polygon coordinates in this file.
I'll take a stab at it...
First of all, I'm not sure where "statesData" is coming from. To convert a .csv to a geoJSON, use this site: http://togeojson.com/. Be sure you format it correctly.
Next, you'll want to paste that geoJSON into your html document. Maybe something like this (there are better ways to do this I'm sure):
var statesData = [{... //paste geoJSON here }];
Next, you can add the layer:
L.geoJson(statesData,{}).addTo(map); //style polygons inside the curly brackets
That'll get the geometry, which is stored in the geoJSON file itself, to show up on your map. Look at this link for guidelines on how to style your polygon.