Franz Buchinger
2009-Apr-30 14:15 UTC
[Mapstraction] Synchronous Mapstraction API vs. asychronous Provider Plugin
As I already mentioned, I''m developing a plugin for a custom map provider using the new mapstraction architecture. My main problem is that I have to communicate asychronously with the map providerserver (AJAX requests), whereas the mapstraction api is synchronously. So my plugin actually has to "wrap away" the asychronous behaviour (i.e. avoid callback functions) and behave sychronously, which is quite an issue in Javascript. Do you know of any js patterns that can remedy this issue? Franz -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20090430/f1012974/attachment.htm>
Andrew Turner
2009-May-01 22:38 UTC
[Mapstraction] Synchronous Mapstraction API vs. asychronous Provider Plugin
Franz Buchinger wrote:> As I already mentioned, I''m developing a plugin for a custom map > provider using the new mapstraction architecture. > > My main problem is that I have to communicate asychronously with the > map providerserver (AJAX requests), whereas the mapstraction api is > synchronously. > > So my plugin actually has to "wrap away" the asychronous behaviour > (i.e. avoid callback functions) and behave sychronously, which is > quite an issue in Javascript. > > Do you know of any js patterns that can remedy this issue? > > FranzIf you look at how the "not loaded yet" handling is done in Mapstraction itself - may serve as a model. Does the provider JS provide a callback when the command is done?