Hi,


kthomps17 wrote:
> 
> I'm building a store locator style product and I'm not entirely sure that
> my design is even possible.
> 
> I'm using google maps api v3 (javascript), mysql-python and mysql.
> 
> My javascript produces a map of U.S. before the criteria of user address
> and search radius are entered. Upon hitting the submit button, the
> javascript geocodes the user's address and produces a marker for it on the
> map. I need to pass the user's latitude & longitude from my javascript to
> my python to query my database of store locations and produce a list
> (hopefully in XML format) that I can pass back to my javascript and then
> use that to create the markers for the stores within the radius.
> 

Are you using Plone - I didn't find any hints how this question would be
Plone related. But I'll answer in any case as we have built some store
locators in the past :)




> Does this seem like it would be possible to any one? I'm new to using
> Javascript in general so i'm not sure what my limitations are and I know
> that the sequential process i'm looking for here might have a performance
> hit so if anyone has idea's for alternatives i would appreciate that also.
> Also I'm not sure how to create an xml file that will be accessible from
> within the plone structure.
> 

Why do you think it wouldn't be possible? Plone is open source software and
only your imagination is the limit :) What you probable want to do is a
perform AJAX call which HTTP POSTs user coordinates from Google Map (GMap
Javascript API) to the server side handler. Plone's case this would be
BrowserView class. Then the server uses lat and long to perform query from
the database and pull out the list of the nearest stores. The database can
be XML file which is parsed during Plone start-up, or MySQL database using
Python normal MySQL libraries. 

After the list is pulled out, sorted by the nearest distance, the HTTP POST
handler returns the store location data as HTML output or JSON object. The
browser Javascript reads this response and places the bits of the pages to
the correct position on the web page using DOM manipulation.

Ps. If you want to create a mobile version of your store locator check
http://webandmobile.mfabrik.com


-----
Mikko Ohtamaa
Mobilize your Plone site - http://webandmobile.mfabrik.com
mFabrik - Freedom Delivered. - http://mfabrik.com

-- 
View this message in context: 
http://plone.293351.n2.nabble.com/Using-Javascript-python-xml-in-Product-tp5827396p5828060.html
Sent from the Product Developers mailing list archive at Nabble.com.
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to