i am newbie to web development in all aspects;
i've went through the bast tutorial of django and now i would like to construct something which can launch a map on html, let the user pick a location and return the (lang,lat) coordinates back to django;
any ideas of how generally this should be accomplished?
if you got a working example it would be even more nice.
Thanks
have you tried http://djangosnippets.org ?
Google Geocode Lookup: http://djangosnippets.org/snippets/293/
Get Latitude and Longitude from google maps: http://djangosnippets.org/snippets/483/
There's GeoDjango, which is Django with Geospatial capabilities - it uses a spatial database such as spatialite or PostGIS.
That will do for database management. For map presentation, use OpenLayers or some other open source javascript map framework.
Hopefully that's enough for you to do some research and find a solution. If you've got more specific questions, ask them either here or more likely on the gis.stackexchange.com site.
Related
I’m working on a vuejs project, I want to make some data visualisation on a map: display a map and show some percentages for each country. I really do not know from where to start. What tools to use ? Is there some tutorials and javascript libraries that can help ? Thanks !
If you just want to show some percentages on each country, and you don't need those detail information on the maps, maybe you don't need Google Maps.
Try D3.js. There are several examples you can build with. DataMaps would be a good choice.
you could use the google maps api, they have good documentation on all their stuff.
https://developers.google.com/maps/documentation/
It should be noted however that these days you need a account with billing information to use their maps api's.
to be honest your question is so broad that if i were you i would first start to brainstorm and get a good grasp about what i wanted to do and how to do it.
I am familiar with coding in python for the work I do in bioinformatics. I've recently been asked to do a different type of analysis -- analyzing data and then overlaying that data over a map of the US. I figure I will need to use javascript after I write the python code to do the data analysis, but I am not familiar with creating images. What is the best way to incorporate my python data analysis with code that will produce a dynamic image?
Thanks for your help.
My Solutions
1) Just as what what other people said , you could try to use the Google Map APIs and code a bit.
2) Or you can use Openstreetmap. I would perfer openstreetmap.
I did several apps and websites based on LBS. I know how to place coordinates on maps.
If you want to finish this quickly and cooler. You may try this combination:
Django as the freamwork,
PostgreSQL as the DB backend
PostgreSQL PGIS as the geolocation handler
Openstreetmap as the map viewer
My summery:
Solution 1) is quick, faster. It needs you some hard-coding efforts.
Solution 2) is bit slower but full-featured. It's very extensive for future developing.
Hope this could help you
I'm trying to set a border around some districts in the UK, similar to how Google do it on here : http://g.co/maps/wbtj3
Does Google release the latitude and longitude data for districts? I cannot see anything in the API which will allow me to search for a district and get the data for it to display on the map.
Is there an easy way to "extract" the latitude and longitude data for a district for use in an polygon?
It seems that American data is easier to find (http://econym.org.uk/gmap/states.xml) or am I not looking hard enough?
Appreciate any advice :).
Edit: I believe it's pretty new as I can't find much info about it "highlighted search results" - http://googlemapsmania.blogspot.com/2012/01/highlighted-search-results-in-google.html
OpenStreetMap has boundary data for English Counties which are free to use and available in multiple formats.
As far as I know, Google does not provide any underlying map data via an API.
Getting co-ordinates for a polygon would require GIS files and a GIS software like MapInfo to read.
My advice would be visit this site;
http://bbs.keyhole.com/ubb/ubbthreads.php?ubb=showthreaded&Number=332073
Download the KML file which has the district boundaries of UK counties and then use it in either google earth or fusion tables.
Finding out what your using these for may help get a better answer...
I think you'd have to figure out the polygon coordinates yourself. If it was only for a few districts, maybe not such an onerous task. But if it's for the whole of the UK... Here's a website that will quickly give you coordinates as you draw polygons:
http://www.birdtheme.org/useful/v3tool.html
afaik google doesn't offer such service in his APIs. But you could download you file of interest here: http://www.gadm.org/country
if you grab it as kml, you could easily import it into Google-Maps.
Just came across this thread - you may have solved the problem a long time ago, but this may be useful:
http://mapit.mysociety.org/
Im using the google earth v1 javascript API to update hundreds of objects moving around in "real-time". I keep track of new, modified, and deleted entities to minimize looping in my javascript while updating placemarks, but still the biggest bottleneck is making the calls to the google earth api. Has anyone else tackled this problem? I've read a bit about dynamically streaming from a KML file on a server, but I need access to the placemark object updates in my javascript code.
There is a v3 of the Google Maps Javascript API, but the Google Earth API is at v1. It's unclear from your question if you are using both API's, and if so, how you are interacting with the Earth API.
If you provide some code showing how you are doing the updates it would be easier to offer advice on how to optimize.
That said it sounds like using straight KML with incremental Updates is the way to go for your use case, and you can still access individual placemarks using the getElementByUrl() method
To put a bow on this question. Using dynamic KML files is one way to do this if you dont need to do anything complicated with the data other than display it to the user. Because I need to do work on the data inside the webclient, I ended up using json to transfer the data and then using google.earth.executeBatch to execute my google earth api calls in the most efficient manner.
Have you looked at using Google Fusion Tables? It doesn't use the GE plug-in so....
I am trying to embed a Google Map into a dynamic webpage. The only variable the map depends on is the address of a business. That address comes from the website's database. I cannot just statically generate embed code for each dynamic page using the same set up. Is there a way I can embed a map based on that address and show a marker/bubble showing Google's information on that business?
So far, I have explored a few options including using the Google Map API and the Google Data API or just messing with the embed code given by Google. If I use the APIs it seems I have to design my own types of markers and maybe even supply my own data.
It doesn't look like there is an easy solution.
Any ideas?
Thanks.
EDIT: I'm not hung up on going from an address to a longitude and a latitude. I want the info window or "bubble" for a marker to show Google's information of a business.
EDIT: On Roy's suggestion I have been trying to use the map and search API together to achieve what I want. However, the only way I can execute a search with searchControl.execute('business name here'); is if the SearchControl is drawn. Thing is though I don't want to show any search controls. I have been able to hide it, but that just seems like an inefficient hack way of solving this.
Don't just use the embed code. Write a bit of Javascript that will draw a map for you and pass it the address.
Loads of examples here:
http://code.google.com/apis/maps/documentation/examples/index.html
I'm not sure which bit you're stuck on, but you don't need to design your own markers. Google can also create a marker from an address and it can find local business information if it has it (using local search API I think).