googlemaps-samples / codelab-locator-maps-js Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://codelabs.developers.google.com/codelabs/google-maps-simple-store-locator/
License: Apache License 2.0
Home Page: https://codelabs.developers.google.com/codelabs/google-maps-simple-store-locator/
License: Apache License 2.0
I'm trying to add the store coordinates with the lat long of the places in my country, but it is not showing up in the map. Is there any other thing I need to add ?
The third line of the input in step 4 of the "Hosting with Google Cloud Storage" codelab
$ gsutil -h "Cache-Control:no-cache" cp * gs://gmaps-store-locators
should be as follows:
$ gsutil -h "Cache-Control:no-cache" cp * gs://yourname-store-locator
Please update the text of the codelab accordingly.
Hi @stephenmcd
I tried with the code given but it keeps giving error as in attachment. However if I move the js code to the same html file it works fine.
Please add notes to the copy that describe that GeoJson coordinates are 0 => Longitude, 1 => Latitude. The Google data.loadGeoJson does not respond with an error message and there is no way to tell what is the issue. It just will not load. Not everyone is familiar with GeoJson. Also here is a tool that helps out: https://geojsonlint.com/
Thanks.....
Sorry if I'm missing this, but I don't see any mention in the tutorials about the user entering their address or using geolocation to show the stores near them... is this correct?
Hi,
I followed the codelab https://codelabs.developers.google.com/codelabs/google-maps-simple-store-locator
In step 7, the store list does not show up, even if I just copy the code directly from the git repo and only change the "YOUR_API_KEY "
Thanks
The locations used in the original stores.json file load perfectly and everything else runs well. However, when I replace with my own locations, nothing loads on map, and if they do, they load on previous restricted country not mine and directions aren't calculated at all. I have already set componentRestrictions option to my own country code and centered the map with my location coordinates.
Kindly, tell me what I am doing wrong.
After Step3 when trying to preview:
Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details
The line
const map = new google.maps.Map(document.getElementsByClassName('map')[0], {
showed the "google" is undefined error.
EDIT: solved when enabling Google Maps JavaScript API (there are three Geo APIs and that's the one required)
With the arrival of Python 3, the command to start the server is now: python -m http.server 8080
.
Thanks!
If you have more than 25 locations in our json file this will not work. Is there a work around or another solution for calculating distances for more than 25 stores? Or is it possible to get only the destinations that are in view at the current zoom level?
Stores.json doesn't work
It looks like the old codelab Google URL has changed to: https://developers.google.com/codelabs/maps-platform/google-maps-simple-store-locator
It appears that there is some limit to the number of stores in the side list of stores that this method will allow.
adding few stores to the JSON file, so that there are more than 25 stores, cause the Store list to stop from showing up.
How to adjust this limit?
Distance Matrix API must be enabled to be queried.
https://codelabs.developers.google.com/codelabs/google-maps-simple-store-locator/#4
has a step:
Run the following command in Cloud Shell to download the marker and logo graphics. Make sure you're in the store-locator directory. Use Control+C to stop the simple HTTP server if it's running.:
$ mkdir -p img; wget https://storage.googleapis.com/gmaps-store-locator/assets.zip -O temp.zip; unzip temp.zip -d img; rm temp.zip
https://storage.googleapis.com/gmaps-store-locator/assets.zip is a dead link.
mkdir -p img; wget https://storage.googleapis.com/gmaps-store-locator/assets.zip -O temp.zip; unzip temp.zip -d img; rm temp.zip
--2020-10-15 23:09:09-- https://storage.googleapis.com/gmaps-store-locator/assets.zip
Resolving storage.googleapis.com (storage.googleapis.com)... 74.125.142.128, 74.125.195.128, 2607:f8b0:400e:c08::80, ...
Connecting to storage.googleapis.com (storage.googleapis.com)|74.125.142.128|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-10-15 23:09:09 ERROR 404: Not Found.
Archive: temp.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of temp.zip or
temp.zip.zip, and cannot find temp.zip.ZIP, period.
Press F to pay respects, or maybe it will get hosted again soon, thanks for taking a look
Previous issue of "Store list does not show up" was not solved.
following the steps in codelab (using Mac), copying the code from git on both Chrome and Firefox creates a site without the list of stores.
is this just an old deprecated code example?
is there a current version that does work?
Are there some requirements around cookies acceptance that might cause that?
Thanks
A link to an example app that demonstrates the end result would be useful.
I'm only seeing an image placeholder instead of the Google Streetview image below the store details. The URL being created is: https://maps.googleapis.com/maps/api/streetview?size=350x120&location=51.5125168,-0.1428115&key=(My-API-KEY)&solution_channel=GMP_codelabs_simplestorelocator_v1_a
(I removed my API Key above, it's showing in the actual URL)
I thought it was an error in my working code, but after completing the exercises and uploading the code from GitHub, the images still are not appearing below the details. I'm getting a 403 status when this URL is being loaded.
images download link broken
https://storage.googleapis.com/gmaps-store-locator/assets.zip
Hi Guys,
Step 4 or Point "7. List the closest stores"
"Finally, enter a UK address into the Autocomplete search bar and click on one of the suggestions.
The map should center on that address and a sidebar should appear listing the store locations in order of distance from the selected address. One example is pictured as follows:"
Is not working
The provided starting centre of the map is incorrect for the mentioned location.
Line 5 of app.js " center: { lat: 52.632469, lng: -1.689423 },"
Clicking on this menu item will open a new tab in your web browser with the content of the HTML served from the simple Python HTTP server. If everything went well, you should see a map centered on London, England.
Those coordinates actually centre you in Tamworth see: https://www.google.com/maps/place/52%C2%B037'56.9%22N+1%C2%B041'21.9%22W/@52.6324722,-1.6916117,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d52.632469!4d-1.689423
Running the below command creates the img directory but does not download the assets. The assets in the temp.zip are returned with a 404.
~/store-locator$ mkdir -p img; wget https://storage.googleapis.com/gmaps-store-locator/assets.zip -O temp.zip; unzip temp.zip -d img; rm temp.zip
--2020-06-25 09:17:44-- https://storage.googleapis.com/gmaps-store-locator/assets.zip
Resolving storage.googleapis.com (storage.googleapis.com)... 172.217.214.128, 2607:f8b0:4001:c03::80
Connecting to storage.googleapis.com (storage.googleapis.com)|172.217.214.128|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-06-25 09:17:44 ERROR 404: Not Found.
Archive: temp.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of temp.zip or
temp.zip.zip, and cannot find temp.zip.ZIP, period.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.