title: Best mobile store locator solution with 10.000+ markers
body: <p>I'm developing a store locator web-application for mobile (iPhone). The idea is standard, the device uses its geolocation feature to determince the location and should then display the 5-10 closest stores on a map. My problem is essentially that I have too many stores (10.000+) and haven't yet been able to create a nice user eperience. </p>
  
  <p>I realize this may be a bit much to ask but I'd love to hear your thoughts on this..</p>
  
  <p><b>PROBLEM SCOPE:</b></p>
  
  <p>i) I figure I can only load some of the markers at once rather than all of them which I found that a lot of the &lt;100 stores-finder apps do.</p>
  
  <p>ii) It should be bad connection friendly: i.e. google maps should for example not be made to zoom in and out unecessearily causing new tiles to load (and a empty screen to show if the connection is bad) </p>
  
  <p>iii) it has to somehow cope with the fact that the device gps/tower triangulation can be slow to get an sufficiently accurate fix on your position (often a minute or two if indoors or in an rural area)</p>
  
  <p><b>SOLUTIONS I've tried:</b></p>
  
  <p>I) Use getCurrentPositition and from that lat/lng load 5 closest markers. Issue: the snapshot positioning is inaccurate and often the 'wrong' 5 stores are loaded.</p>
  
  <p>II) Use watchPosition until accuracy reaches &lt;100m and then load closest 5 markers. Issue: often takes way to long to get the position (often >1 minute), not a good UX. </p>
  
  <p>III) Same as II only markers are loaded contionously while it finding exact position. Issues: It gets real 'jumpy' using fitbounds() or panTo() every time there is an update. I.e. if the user tries to say click a marker while the map is still in 'find position'-mode they will be intrerupted by the map changing bounds and loading more markers.</p>
  
  <p>IV) Fit bounds to an approximate position using watchPosition and a fixed zoom and use center of the map to get the closest stores. Continously load markers as watchPosition finds a better approximate center or the user himself pans the map. Issues: Again, a bit jumpy since watchPosition updates alot. No 'your position' marker.</p>
  
  <p><b>BACKGROUND INFO:</b></p>
  
  <p>I'm using much of the standard google method of creating a store finder, shown here: <a href="http://code.google.com/intl/sv-SE/apis/maps/articles/phpsqlsearch.html" rel="nofollow">http://code.google.com/intl/sv-SE/apis/maps/articles/phpsqlsearch.html</a></p>
  
  <p>Google Maps v3 API, MySQL database, Haversine formula, JSONP asychronous loading of marker-data, no libraries (jQuery or such). Loading 5-10 new markers with this method usually takes less than 1s.</p>