Website; let user add location and get coordinates - mysql

I've been developing a website where users can add a place (say a store in a city) and it is stored in a database. Now I would like to be able to display these places on a interactive map on my website. I got a bing maps developer key but it seems i can only display the data if i have the coordinates (lon/lat). Is that true? And if so, how do I get the coordinates automatically once a user adds new data?
As an example: You add Store XYZ in City XYZ, but you DON'T have to enter the coordinates. Now, this info is stored, but I don't have the coordinates..
Any help is much appreciated!

If you don't have any plans on allowing your users to insert place locations in a map or by filling some lat/long data, I suggest you to use google web services to get geolocation of those places. You'll need to format the input you send into something like an address to get it working properly though.
See this Google documentation

Related

How can i allow user to insert location into mysql database using flask

im creating a website using python flask, in the website the user should upload locatin, rate and add a description. im having trouble with finding a method that will let the user insert google map location to MySql database. can i use only my flask app and MySql database for doing that or i need php as well?
Thank You!
It depends on what sort of location you are looking for them to upload. If you are talking about an actual geographical location (ie a pin dropped from a Leaflet.js map) then you can store this in your database as two rows: latitude and longitude.
However, I suspect from your question that you instead want to identify a "place" (eg a restaurant, bar, hotel, park, landmark, house, etc) in which case lat/lon is a poor choice because there may be places which are very close to each other or on top of each other meaning you will have overlap; and you don't want a cluster of individual pins near to each other all referring to the same place.
In that case, you will want to look into something like Google Maps Place ID which assigns a unique identifier to each "place" on Google maps. For instance in your database you you could store a Place ID as a string of "ChIJFZo6iUSVwoARNU6w60iDGqY" (the In-N-Out Burger in Burbank California).
Other mapping services will have their own equivalents.

Free geocode API allowing store names and coordinates

My application should allow users to store events and their locations and then perform search on them - so I need those locations in my database with their names and latitudes/longitudes. Google API doesnt allow storing anything else but place IDs so I have to find something else that can autocomplete/suggest places on UI and allow storing it my database.
Does anyone know such a good service?
You can simply add your points in your DB based on each point Lat & Long values. So when user is searching somewhere you have his current location(Lat-Long), Therefore you can search in your DB and get the distance of each saved point with current location and retrieve the results you want to show (i.e in JSON format).
In client-side use some auto-complete jquery library to show the nearby places and somethings like that (with additional information).
Google Map API has a service that you can show some custom marker on the map with your custom configuration like marker icon, description and etc. You can show your additional information in description as HTML format.
You can see some example here:
Customizing a Google Map: Custom Markers
Hope these tips would be helpfull. Regards.
Suddenly I've found an answer that helps me:
https://productforums.google.com/forum/#!topic/maps/hNc1OOU6Zm8
So I can use some Google's data under some conditions.

How do I store and retrieve locations for google map into mysql database

I'm sorry, I'm extremely new to google map, thus I need some help here.
I want to store and retrieve locations that I've input and display in the google map.
Any startup for me to get me going? Thanks.
Try Google Earth, it will save locations in kml, and and you can feed data to it from an external source. You can also place marks in Google maps if you are signed in. Other wise you didn't give enough information

Google Maps Store Locator Search field for embedded map

I've embedded a map on a clients site, with their various store locations, using the google saved maps technique: http://passportal.com.au/stockists So basically I don't want store the marker locations in a database, I'm just interested in using the marker positions on the saved map as seen in this demo: http://maps.google.com/help/maps/getmaps/plot-multi.html
I've seen it on plenty of sites and am wondering if there is an easy way to add a search field to find the closest marker to the users address. Something like this: http://www.victoriantextiles.com.au/store-locator
The closest I could find was a google gadget that allows you to type in directions: http://www.google.com/ig/directory?synd=open&hl=en&gl=en&url=http://igwidgets.com/lig/gw/f/islk/89/slkm/ik/s/1329844/87/charles447/google-maps-driving-directions.xml
Any help would be great, thanks!
For this purpose, I use Google Maps API Distance Matrix where I would pass in one origin - user's location and multiple destinations - our dealers. Then I sort the results by distance and take 3 closest to display in a list. Works pretty fast, however, I don't know how you'd achieve this without having some sort of database of your store addresses.

Let Users Save and Display Locations on a Map

I have a web site and I'm trying to implement this:
Some users (let's call them shop owners) will put a pin (to indicate a shop) and describe what's out there. They can save as many pins as they want.
Other users (customers) will make searches for shops.
Searches will only consist of location names.
For example, if a customer makes a search for "Champs-Élysées, Paris, France", the system should show him shops around Champs-Élysées.
Can I make use of Google Maps API (or Bing, if there is an API for it) for it? Or any other ways? I'm open to all kinds of guidance. So please feel free to comment on my requirements too.
Allow users to click on a map and create markers in your database (here). You can show a javascript prompt to let the customer type in the name of the store.
Create a form where users can enter a city. Search through your added markers for markers in that city. Or even better geocode what the user types in and use the lat/lng in the database to find markers within a certain radius