Hi, Right, I think I got that far. But when I try to add it to data store, I get the following error.... GeoPtProperty is supposed to take GeoPt data type, which is "geographical point represented by floating-point latitude and longitude coordinates." But it doesn't say whether it needs to be a list or tuples... Any help would be much appreciated. Thank you in advance!
File "C:\Program Files\Google\google_appengine\google\appengine\api \datastore_types.py", line 596, in __init__ (lat, typename(lat), lon, typename(lon))) BadValueError: Expected floats for lat and long; received (37.3096785453849 (a unicode) and (a unicode). And in my python code looks like this... class LocationInfo(db.Model): geocode = db.GeoPtProperty() equip = db.ListProperty(long) rating = db.RatingProperty() class AddLocation(webapp.RequestHandler): def post(self): loc = LocationInfo() loc.geocode = self.request.get('latlng') loc.put() self.redirect('/') And my javascript looks like this.... GEvent.addListener(map, "click", function(overlay, point) { if (marker) { map.removeOverlay(marker); } var iwform = '<form action="\addDB" method="post">' + "<input type=\"hidden\" name=\"latlng\" value="+point+">" + '<label for="place">Name:</label><input id="id_place" type="text" name="place" size="15" value=""/><br />' + '<input type="submit" value="Save"/>' + '</form>'; var marker = new GMarker(point,{draggable:true}); map.addOverlay(marker); map.openInfoWindowHtml(point, iwform); } On Oct 10, 7:57 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Without getting too much into the details, you'll probably want to do > an asynchronous (AJAX) request to your web app. Basically, once the > geocode request has gone through and you have the coordinates, fire > off another request to post the coordinates and associated data to > your AppSpot for storage. > > -B > > On Oct 9, 3:56 pm,Yang<[EMAIL PROTECTED]> wrote: > > > Hi, > > > I am sorry for such newbie question... I would appreciate any help. > > > I am trying to write a simple code which allows a user to place > > markers on a map and save them. Those saved markers would be displayed > > to everyone. There are more thing I want to do past it, but I am stuck > > at saving the markers geocode to the Datastore. I created db class, > > and initialized instance of it, but since marking activity happens in > > javascript, I don't know how to pass the geocode information from > > javascript portion to <body> part of HTML code so that it could be > > saved. Also, in reverse direction, I need to pass geocodes of all > > markers in the map canvas to display them. I am very new to the whole > > Google App Engine thing, so any help would be much much appreciated. > > > Thank you, > > > -Yang --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---