BIOSTALL / CodeIgniter-Google-Maps-V3-API-Library

The library enables you to create a map and overlay multiple markers, polylines, polygons, rectangles, ground overlays and/or circles, all of which are fully customisable. The library also supports showing directions between two points, including the ability to show the textual directions alongside the map too, and marker clustering. The first stages of integration with the Google Places API are available for use too.
http://biostall.com/codeigniter-google-maps-v3-api-library
288 stars 199 forks source link

add_marker by address too slow when there are 100+ markers #68

Open atiyehk opened 6 years ago

atiyehk commented 6 years ago

Example below takes more than 10 mins to load. Didn't really debug the add_marker function, but I am assuming its trying to resolve the address to lat/long, etc.. which might be causing it to take too much time?

foreach($query as $sale) { $marker = array(); $marker['infowindow_content'] = ($sale['client_name'] . ' - ' . $sale['quote_unit_number'] . ' - ' . $sale['item_name'] . ' - ' . $sale['quote_number']); $marker['position'] = $sale['client_address_1'] . ' ' . $sale['client_city'] . ' ' . $sale['client_state'] . ', ' . $sale['client_zip']; $this->googlemaps->add_marker($marker); }

atiyehk commented 6 years ago

Maybe we should add async support to loading locations when there are so many. Since all the locations are being loaded on the server, its causing the application page to hang until all addresses are resolved to lat/long

atiyehk commented 6 years ago

I ended up cache the addresses lat/longs to make this faster. No feedback about the issue so needed to get a workaround.