oodya Posted February 6, 2012 Share Posted February 6, 2012 Hi, I am just wondering if there is any way that I can link Google Maps which will then link to my product stocklist - see attachment for what I am trying to achieve. Please let me know if this is possible. Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/256529-link-product-list-to-google-maps/ Share on other sites More sharing options...
Drongo_III Posted February 6, 2012 Share Posted February 6, 2012 Not overly familiar with Google maps API as haven't really used it much. But in theory it's perefectly possible to get their location (i.e. gelocation - http://code.google.com/apis/gears/api_geolocation.html )then have a script on your site that would calculate the closest shop (if product exists) using something like google maps distance matrix thingy - http://code.google.com/apis/maps/documentation/distancematrix/ . And if you've gone that far then displaying the shop location on a google map should be a piece of apple pie! Quote Link to comment https://forums.phpfreaks.com/topic/256529-link-product-list-to-google-maps/#findComment-1315075 Share on other sites More sharing options...
oodya Posted February 6, 2012 Author Share Posted February 6, 2012 Hi, Many thanks for the prompt response. I can read through the links that you sent me and see what I can come up with. I just have one more question - How do I link the maps to my stocklist? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/256529-link-product-list-to-google-maps/#findComment-1315088 Share on other sites More sharing options...
Drongo_III Posted February 6, 2012 Share Posted February 6, 2012 Hmm i think the best solution to that will come out of you becoming much better acquainted with google maps api (which i'm not). But i would imagine your stock table (simplifying this of course) might have a related table for store locations (so every product is assigned to one or more stores). You might store the geolocations of those stores in the DB since they wont change. Then when someone browses for say 'pumpkins' on your site, your script looks up the item, and finds the stores in which that item is located. So you now know that pumpkins are stocked in store 1 and store 2 and you have the geolocations of those stores. You might then have a "user location " function and a "distance " function. The user location function would pinpoint the user's location. The distance function would 'range check' the user's location relative to the store locations you've stored. Then you might run another function to display this data on the map (through google maps api). As i said that's all very simplified and speculative as i'm not overly familiar with google maps api but i reckon that's doable. Hi, Many thanks for the prompt response. I can read through the links that you sent me and see what I can come up with. I just have one more question - How do I link the maps to my stocklist? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/256529-link-product-list-to-google-maps/#findComment-1315090 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.