how hard would it be to add a lat and lon text field.?

14 views
Skip to first unread message

Matthew Cooper

unread,
Jan 29, 2014, 2:31:07 PM1/29/14
to olwi...@googlegroups.com
Hi

We've been using a custom widget for PointField in admin but the Google update to v3 has stopped it working.

olwidget looks great, except that I currently allow users to enter a lat/lon and click a button to locate the point on the map. They then drag the marker around to the desired position (and the lat/lon fields update with the new coordinates).

I've started reading through the source but uny thoughts on implementing this would be greatly apprecaited!

Thanks

Matt

Matthew Cooper

unread,
Jan 30, 2014, 7:28:12 AM1/30/14
to olwi...@googlegroups.com
Found this post by Mike Fletcher:


This does almost everything I need, allows the user to enter the coordinates and then updates the map...

however, when I inherit from from olwidget.forms.MapModelForm (even without this custom template) it doesn't set the initial position on the map which is strange.. Looking at that now.

M

Matthew Cooper

unread,
Jan 30, 2014, 8:13:21 AM1/30/14
to olwi...@googlegroups.com
Textarea isn't populated with the existing coordinates for the PointField  when I use MapModelForm, it is when I use the standard forms.ModelForm

Wondering if this is because I'm using Grappelli...

Matthew Cooper

unread,
Jan 30, 2014, 8:57:21 AM1/30/14
to olwi...@googlegroups.com
I went through the test project and I had a couple of the settings wrong. all working now.

I will add a geolocation text lookup now and it will be perfect.


Reply all
Reply to author
Forward
0 new messages