I loaded ~35,000 locations via the Feeds Module (csv format) for store locations around the United States. When I navigate to the /store_locator page the no markers or locations are returned from /store-locator/json. I looked at the view for this and it is giving a 500 error.

Is there any way to make this work? What would be the reason for the 500 error with the view? Any ideas on how to make this scale for this number of locations?

Thanks!!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jusdavi’s picture

Update:
I tried to limit the results to 25 in the view and it now returns 25 null locations. I confirmed all 35K locations got migrated in successfully with no blank locations or issues when using Feeds for data import into Store Locations content type. So I'm not sure why it's returning null when I limit the results.

Starbucks (http://www.starbucks.com/store-locator) has a great example of not fetching the location results until a location is entered in the textbox or allowed via browser or zoomed in close enough on the map; before it returns store locations to the user. I'm wondering how to adapt the current Google Store Location module so it fetches just a few locations (25-50) rather than trying to load all 35K locations and returning a 500 error.

jusdavi’s picture

This may be similar to what I'm looking for:
https://drupal.org/node/1943542

jusdavi’s picture

Update:
It looks like when I migrated in all the Store Locations data via Feeds that non of the locations were geo-located. None of them have a lat/long. When you create a store location node manually the lat/long gets assigned but not when mass importing Store Locations via Feeds. Any ideas on how to get those to automatically geo-locate on import? I guess another option would be have the lat/long prior to import but that proves to be a challenge as many service put a limit on how many you can per day.

Horroshow’s picture

Just found out how to import with Feed module. When configuring the Feeds module, go to the Processor parameter and choose Store Location, under Content Type drop down menu choose Store Location. Then in the mapping setting all the correct targets will appear.

theo_’s picture

Status: Active » Needs review
FileSize
5.89 KB

I had a touch based with michfuer about this issue.

Actually the issue is about the data source. As data source we use the Location export view (available at /store-locator/json), this view is in charge of loading and formatting data but actually it load EVERY store location and doesn't provide a way to filter results.
It result in having all markers loaded and processed every time you see & move on the map, even if you are only zoomed to a specific point on the map.

To fix that I provide a patch which allow us to filter store location by latitude and longitude, thus we only load markers within the map boundaries. This is similar to Viewport Marker Management approach from Google but handled by Google store locator library.

Added:
- Dependency on Views Contextual Range Filter module
- Latitude and longitude contextual filters on the Location export view
- Updated google store data source to make use of getStores() method.

To apply this patch:
- Download and apply attached patch. (help)
- Download Views Contextual Range Filter module
- Run updates

michfuer’s picture

Status: Needs review » Closed (fixed)

The patch along with some tweaks has been committed to the dev branch. Viewport Marker management along with marker clustering is now available.

laz0rama’s picture

Issue summary: View changes

i am wanting to basically store a static file (the output of the json feed view) on disk, and have the module use that file rather than calling the view for all 5k+ stores we have, which currently means every store locator search takes 30-60 seconds. what i don't know is:

1. where would i put that file, and with what name, so that the module uses it instead of the dynamic view?

2. what do i need to do, code-wise (or otherwise) to get the module to use a file rather than the view?

thanks so much for any direction you can provide.

-laz