Extension, Fieldtype, Module, Plugin

Archived
Forum
(read-only)

Google Maps for ExpressionEngine

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Objective HTML

     

Client side vs. server side geocoding

Support Request

pEEter
pEEter

Hi, I’m still fairly new to this so please bare with me. I’m trying to wrap my head around the concept of client-side and server-side geocoding with Google and how it relates to the 2500 requests/day quota Google gives.

Does Google Maps for EE use client side or server side geocoding? In the docs there is a warning about proper design and caching of your data to prevent running into the limit but practically speaking, the way I understand the quota, if it’s client-side geocoding then each user at a unique ip address would need to make 2500 geocoded requests/day to reach a limit? That seems unlikely. However, if GM for EE uses server side then a moderately busy site would easily hit this limit.

I’d appreciate a clear explanation of how to use the geocoded feature of GM for EE so I can design my app properly and avoid excessive geocoded requests. In the app I’m working on, using reverse geolocation is a primary part of the feature-set.

Thanks!

pEEter
# 1
pEEter

Still wondering about this. Anyone have anything interesting to say? Thanks.

Objective HTML
# 2
Developer
Objective HTML

Sorry for the delay on this. I was out of town at PeersConf all last week and been using today to get caught up. I don’t have time to properly reply right now, but I wanted to let you know that I did get this and will get back to you asap. It will most likely won’t be until tomorrow until I get a chance to reply.

pEEter
# 3
pEEter

Thanks, looking forward to the answer!

Objective HTML
# 4
Developer
Objective HTML

Sorry for the delay on this reply, but just had a chance to get back to you on this.

Google Maps for EE uses both server side geocoding and client side, just depends on what you are doing. The fieldtype for example uses Javascript, so it’s all client side and will not affect your limit. This would be the ideal way to display markers on the map. Using the FT tag, it uses saved coordinates so no further geocoding is needed.

You have the option to use server side geocoding with the marker tag if you need it. Google Maps for EE does cache everything, and you can adjust the link of the cache in the config. The search also uses server side geocoding, which is also cached. Google Maps for EE is used on some high traffic sites and noone to my knowledge has ran into any limit issues unless they were on a shared IP, because the limit applies to the whole server so it’s not even Google Maps for EE at fault.

You should be ok if you use the FT and just be sure to save your coordinates in the channel entries.

pEEter
# 5
pEEter

Thanks for your great answer. I think I understand that. One question, if I wanted to save a user’s geolocation info, such as city and lat/long for bringing them back to the same location on return visits to the site how would I do that?

Objective HTML
# 6
Developer
Objective HTML

Hmm… I have never done that before. You could do it a couple ways, but it would require writing your own JS. You could use a cookie or the localstorage api (in html5 browsers) to save the coordinates. Then you could just plot them manually in the template. I don’t have any code examples of this unfortunately, but I know it’s possible. You’ll just have to dig into the code to figure out how to connect the dots.

pEEter
# 7
pEEter

Thanks for those suggestions. I found a script and was able to turn the data into cookies, it works well. Might be a nice feature to add to the module in the future.