Coder Social home page Coder Social logo

googlemaps-samples / codelab-locator-maps-js Goto Github PK

View Code? Open in Web Editor NEW
84.0 84.0 102.0 41 KB

Home Page: https://codelabs.developers.google.com/codelabs/google-maps-simple-store-locator/

License: Apache License 2.0

JavaScript 78.65% HTML 21.35%

codelab-locator-maps-js's People

Contributors

arriolac avatar samthor avatar stephenmcd avatar wangela avatar wiblu59 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codelab-locator-maps-js's Issues

Add more coordinates in store.json

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 ?

Step 4: Hosting with Google Cloud Storage

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.

Please add GeoJson (long, lat) notes on formatting

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.....

Enter current address or geolocate

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?

Replacing current locations with my own in stores.json nothing shows.

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.

Using CodeLab, "google" is undefined

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)

Max destinations?

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?

Limit to store list length

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?

DistanceMatrixService for large data set failing

stores.json has more than 2000 records, so when doing search filter using the text box getting the below error from DistanceMatrixService

simple_store

if the store count is less than 25, its working fine

Is there any limit in the service to get this working with large data sets?

Dead Link in Tutorial?

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

Store list does not show up

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

Screen Shot 2020-01-05 at 10 26 43 PM

Screen Shot 2020-01-05 at 10 29 39 PM

Google Streetview image is not appearing on Popup

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.

a sidebar should appear listing the store locations - Not working

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

Beginning Long and Lat incorrect for london

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

Assets can not be found 404.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.