kmike/django-easy-maps — pull request #2 by gipi (2013-01-04 11:11:14+00:00)
Title: Request for comments

In this branch I tried to implement some ideas

## Media files

Previously the javascript files was included directly in the `easy_maps/map.html` template but when more than one `{% easy_map %}` was used, multiple instances of Google maps javascript could create problems (chrome console complains about this).

In @1f0a767 I used the `Media` class for the widget used in the rendering of the address field.

## Settings

Added (@8f71c84 and @bf15559 to be squashed together) a `settings.py` containing the default to be used when a new instance is created (also used to center the map). Together with the changes in @39645fd is possible to avoid the saving of an instance with an empty address.

## Interactivity

I don't like that for see where the marker will be placed I need to save the instance and come back, so I added some javascript functionality: first of all the `update` button that queries the geolocalization URL (a custom view using `JSON` that responds with the data used to full the form field)

![em1](https://f.cloud.github.com/assets/1107413/42916/13bd6b8e-565a-11e2-8afc-452d3f2ad492.png)

This is introduced in @5ca4a70 where a `geo/` URL is added to the Admin url patterns.

Also I would like to have the coordinates updated when I move the marker on the map (see @d1a0d5a).

## Inlines

An admin class to be used with inlines is added with the same functionalities descripted above, this has required some modification on how functions and `HTML` element classes are named.

There is some example models added in @d1a0d5a that use it.

## Multiple markers

The `easy_maps` tag is improved so to accept also a list of `Address` instances that will be placed in the map (see @39645fd).

## Change list

Since the primary data of this application is geographical data I would like to have a change list page in the admin that contains a map at a zoom level such that all the point are immediately visualized. This (@1755f7d) is a very dirty hack and in future I'd love to implement some interaction between the normal Django table entries and the markers.

## Conclusion

This is not code I'm proud of, it's a little messy and should be reorganized but to avoid useless work I need to know what do you think about these ideas.