Custom maps with iD Editor - javascript

Lately I have been working on a indoor navigation project for a school. It all works but I think it can be faster and easier to edit, so I began searching and came upon iD editor (which is made (?) by OpenStreetMap).
It looks very good. The only thing I can't find is if I can use it with my own maps.
Does anyone know if it is possible, and if not, does anyone know an alternative?
Thanks in advance,
Lars Jansen
The Netherlands

If you just need a simple overlay with some markers or routes then you can use Leaflet or OpenLayers.
It is also possible to create a completely personal map, but it will require to set up a complete backend. iD is just the editor. If you want to see the resulting map in you browser you will need:
a postgres database for storing the map data
a renderer for creating images (tiles) from this database, for example Mapnik
a java script library like Leaflet or OpenLayers for creating a browsable map from the rendered tiles
possibly a geocoding service like Nominatim if you need a search function
As you can see, OSM's main goal is not to create personal maps. Still it is possible but requires some effort to set it up (switch2osm has some useful guides).
Also take a look at similar questions on help.openstreeetmap.org, including possible alternatives:
https://help.openstreetmap.org/questions/27621/personalised-maps
https://help.openstreetmap.org/questions/22827/using-id-editor-to-for-personal-alternative-maps
https://help.openstreetmap.org/questions/11069/does-openstreetmap-have-a-my-places-feature-like-google-maps
https://help.openstreetmap.org/questions/24591/create-my-own-addresses-roads-and-ways-on-a-custom-world-map
https://help.openstreetmap.org/questions/4496/how-to-create-fantasyimaginary-maps-with-openstreetmap

I'm not familiar with this editor specifically, but there are generally two ways to add custom maps:
Image overlay: for OSM it looks like its called Open Layers: http://wiki.openstreetmap.org/wiki/OpenLayers
Custom WMS source: probably overkill - although it looks like partial local caches are supported- so that might be just what you're after: http://wiki.openstreetmap.org/wiki/Creating_your_own_tiles
Sorry I can't help more- good luck!

Related

What technology/strategy should I use to render big GeoJSON files within google maps

I'm currently working on a project to display enriched geographical data within an interactive map. For example, I have housing blocks with additional information added, and I want to display this data within an interactive map. I chose google maps, because I don't have any experience in building a map-based webservice and google seemed to be easy accessible and working.
The problem comes with the amount of information i have. A single town like Berlin has about 450.000 geometrys, which results in a GeoJSON file roughly 170MB big. I know, that this isn't anywhere near to working.
Do you guys can give me a hint on how to structure the project? What kind of technology can I use to dynamically query the needed data? Are there any libraries or working solutions that I should give a try?
How I solved this issue:
I used mapnik to pre-render the tiles and displayed them in google maps using getTileURL. I used this tutorial, which explains the basics on how to use mapnik for google map tiles.

Real time Tracker on Samrtphone using Bing Map

I have read up on GPS Real time tracking and found out several things about it,mostly requiring PHP,but I need use only JavaScript.
As regards to my question, is it possible to do so with just html and JS, using markers or anything else to populate the Bing Map when you move anywhere in the city? Need some help on this, Thanks!
PS: I try to use it on WP8.1, and I am already succeed to add Bing map to it using html5
My solution
and if there is a solution on Win8.1, it's Ok, just how do it?
Yes. In HTML5 you can use the geolocation class: http://www.w3schools.com/HTML/html5_geolocation.asp or since you are using Bing Maps you can use the GeoLocationProvider class: http://msdn.microsoft.com/en-us/library/hh125833.aspx
Make sure you enable share of locations in your app manifest or it will silently fail to get the users location.
This would work in both WP8.1 and Win8.1, and browsers as well.
If you want you can also do all of this in a universal app using .NET.

Use shapefile as a web map?

I am wondering if it's possible to use a shapefile with point features in arcmap as a web map?
I have seen examples, however most of them project the shapefile on top of a base layer map, for example, Google maps or ESRI maps. I am purely wanting to use the shapefile as a web map that supports zoom? Is this possible? If so, how would I go about achieving this?
The only method I can think of so far is to save the shapefile as a service to arcGIS for server...
Any guidance and help will be very helpful.
Thanks in advance.
You could start off by importing the shapefile into TileMill. Once you have styled the layer, you could export it as an MBTile and serve it with Mapbox.
I also found this description that you might find helpful.
http://blog.thematicmapping.org/2012/11/exploring-mapbox-stack-mbtiles-tilejson.html
Good Luck.
If there aren't too many points (more than a few hundred) then you probably want to generate GeoJSON from the shapefile and display the data that way.
You can convert your shapefile to geojson with the GDAL library.
ogr2ogr -f GeoJSON -t_srs crs:84 [name].geojson [name].shp
If there are more than a few hundred points, then I'd use #andrewGeo's strategy.
The easier thing to do would be to share the shapefile from a server like ArcGIS Server or GeoServer. GeoServer tends to be easier to share something simple, especially if you use the Boundless Geo (http://boundlessgeo.com/). That comes with GeoExplorer which can directly consume a shapefile from GeoServer.
Depending on the API you're using to generate the basemap, you can hardcode x/y information into it or consume a KML/KMZ. These tend to be tedious and not great if you're doing more than just viewing static data.
If you choose the server option, beware about hosting and consuming your data on the same server. You may run into Cross Domain issues and life becomes a little more complex then. I believe GeoExplorer automatically bypassed any issues I had with Cross Domain, but most of the other JavaScript APIs were a little more troublesome.
With the release of QGIS 3.8 there is new feature to generate raster MBTiles layers. Once the layer you want to convert is setup, you can open up the Toolbox by either selecting the gear icon or by going into the processing tab on the menu bar and selecting toolbox. Then in the Processing Toolbox, drill-down into the Raster Tools section. Within this section, select the Generate XYZ tile (MBTiles) option. Then you can serve it into mapbox (currently GeoServer does support serving MBTiles as well by installing the MBTiles extension)
Here is a reference to this with a straight forward and well-illustrated example on how to use this new QGIS feature.

Dynamically Load Choropleth using JavaScript

I have a database and web server filled with values for particular countries. I want to be able to display an interactive map that is color coded based on the values from my database upon querying it. (By interactive, I mean a simple zoom-in and move-around feature is all that is needed).
I have the shape files (.shp) of the world, and can easily get KML files as well. This all needs to be done in JavaScript/JQuery (using JQuery to grab the data from the database) and then apply a color code scheme to the shape file (fill in the country borders).
What would be a good JavaScript library to use for this? I have looked into OpenLayers but am unsure it can do what I need (perhaps I haven't dug deep enough).
It sounds like Leaflet.js would be another great option for you. Making choropleth maps in Leaflet is very easy and intercity (zooming) is standard.
You might try D3.js, which is a great framework in general, and has some basic Choropleth support, though I'm not sure how well it works natively with your existing files.
Check out:
http://mbostock.github.com/d3/ex/choropleth.html

Google Maps Javascript API v3 - How to perform some of the more advanced functions

I am trying to create functionality like can be found in this example...
http://googlemapsapi.blogspot.com/2008/05/love-my-maps-use-its-line-and-shape.html
Where the user of the page can draw a polygon on the map by clicking to create the points in the polygon. It seems like all the examples I'm finding of this functionality are in v2 of the API and whenever I try to mimic such functionality using v3 I get a bunch of errors saying objects don't exist and so on. Is it possible to create this same functionality using v3 of the framework? Or will I have to use v2 of the framework.
Thanks
There was a lot of namespaces and object names that changed from v2 to v3, so you won't be able to use the code as it is. But it's not only a name change that is required, the functions have changed slightly as well. I'm pretty sure you won't be forced to use v2 to draw lines, although it will take some effort to copy the functionality to a v3 app.

Categories