-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring the API #2
Comments
I have a custom GMapPanel3 version in use since about a year which adds the feature to remember all markers and center + zoom the map so all of them are visible. |
tim, the geoCodeLookup accepts a center argument that is a bool that decides to center the map or not: geoCodeLookup : function(addr, marker, clear, center, listeners) If this is not working, then that would be a bug. I'm certainly open to pulling in changes that you have, as long as they are generic changes that can be used by all. In other words, nothing that is specific to your usage. |
Well, IMHO most functions do too much. For example, I expect that geoCodeLookup only triggers an address lookup via the geocoder, then doing a callback to the function which decides what to do then. Instead, geoCodeLookup has "hardwired" actions (center, marker, clear etc) which makes it difficult to add custom callbacks. Also, quite some methods have a huge parameter list (where huge is 4 or more parameters) which makes it difficult to handle. I will try to refactor the API to make it simpler to use, but I don't think I can keep API compatibility, at least not for GMapPanel3 (which I'm using). |
I just pushed my first additions to my fork. I try to maintain API compatibility. New methods: |
I agree with timoahummel. I had to modify the method behaviour to accept a zoom value to use after centering. |
Hi,
I'm working with GMapPanel3 for a few days now, and there are a few issues that came into my attention. The API seems to be tied to a specific behavior, e.g. if you call geoCodeLookup(), it always centers the map to the found address, with no or limited possibilities to do custom stuff. IMHO geoCodeLookup should simply lookup the given address, and calling a callback afterwards, instead of trying to center the map all the time, which is probably not what the developer needs.
I might refactor the API on my fork, but if you have suggestions or things that you want to have changed, we could work together on that.
cheers,
Timo
The text was updated successfully, but these errors were encountered: