Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Django OSMGeoAdmin with PointField uses OpenLayers and it's hard to use.

I want to add 2 new input elements which are lat and lng. Using jQuery, when values of the input elements are change, I want to change point on the OpenLayer.

How can I do that? No complete code or instructions are necessary, main idea is enough.

Thanks

share|improve this question

1 Answer 1

i dont know is there any difference with geodjando and OSMGeoAdmin but in normal geodjango if you want to update any field, you can use following code:

def updateVal(request):
  poId = request.POST.get("pointID", default=0)
  objGeo = request.POST.get("meta", default=0)

  f = Points.objects.get(id = poId)

  try:
      f.geom = objGeo 
      f.save()
      res = "OK"
  except:
      res = "ERROR"

i hope it helps you...

share|improve this answer
    
Thank You! but I want to do that in browser side. –  ecabuk Dec 4 '12 at 15:56
    
You could pass an argument to this from the browser using an ajax request. –  djq Feb 2 '13 at 22:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.