title: Django markers using geoposition
body: <p>I use django-geoposition to manage my geodata.
  in my home.html:</p>
  
  <pre><code>&lt;!-- Add Google Maps --&gt;
  &lt;script&gt;
  function myMap() {
    {% for posts in post_list %}
    myCenter=new google.maps.LatLng(34.8402781,135.592376);
    var myLocation=new google.maps.LatLng({{posts.position.latitude}},{{posts.position.longitude}});
    var mapOptions= {
      center:myCenter,
      zoom:7, scrollwheel: true, draggable: true,
      mapTypeId:google.maps.MapTypeId.HYBRID
    };
    var map=new google.maps.Map(document.getElementById("googleMap"),mapOptions);
    var marker = new google.maps.Marker({
      position: myLocation,
      title:'{{ posts.title }}',
      draggable: false,
  
    });
    marker.setMap(map);
  
    {%endfor%}
  }
  &lt;/script&gt;
  &lt;script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCB1CA2DoITfJoFY4HWTLTxH4Avx7QWWqA&amp;callback=myMap"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>But it just shows the fist post's maker on the map. I guess the for loop doesn't work. I don't know what to do. I would appreciate any help!</p>
  
  <p>models.py</p>
  
  <pre><code>from django.db import models
  from geoposition.fields import GeopositionField
  
  class Post(models.Model):
      title = models.CharField(max_length=100)
      introduction = models.TextField(blank=True)
      reason = models.TextField(blank=True)
      transportation = models.TextField(blank=True)
      basic_info = models.TextField(blank=True)
      photo = models.URLField(blank=True)
      location = models.CharField(max_length=100)
      created_at = models.DateTimeField(auto_now_add=True)
      position = GeopositionField(blank=True)
      website = models.URLField(blank=True)
      useful_link = models.URLField(blank=True)
  
  def __str__(self):
   return self.title
  </code></pre>
  
  <p>views.py:</p>
  
  <pre><code>from django.shortcuts import render
  from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
  from .models import Post
  
  def home(request):
      posts = Post.objects.all()
      paginator = Paginator(posts, 6) #每页显示十个
      page = request.GET.get('page')
      try :
          post_list = paginator.page(page)
      except PageNotAnInteger :
          post_list = paginator.page(1)
      except EmptyPage :
          post_list = paginator.paginator(paginator.num_pages)
      return render(request, 'attractions/home.html', {'post_list': post_list,})
  
  def post_detail(request, pk):
      post = Post.objects.get(pk=pk)
      return render(request, 'attractions/post.html', {
      'post': post,
  })
  </code></pre>
  
  <p>attractions\urls.py</p>
  
  <pre><code>from django.conf.urls import url
  from . import views
  app_name = 'attractions'
  urlpatterns = [
      url(r'^$',views.home, name = 'home'),
      url(r'^post/(?P&lt;pk&gt;\d+)/$', views.post_detail, name='post_detail')
  ]
  </code></pre>
  
  <p>urls.py:</p>
  
  <pre><code>from django.conf.urls import url,include
  from django.contrib import admin
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^',include('attractions.urls')),
      url(r'^markdown/', include( 'django_markdown.urls')),
  ]
  </code></pre>
  
  <p>admin.py:</p>
  
  <pre><code>from django.contrib import admin
  from .models import Post
  from django_markdown.admin import MarkdownModelAdmin
  from django_markdown.widgets import AdminMarkdownWidget
  from django.db.models import TextField
  
  class PostAdmin(MarkdownModelAdmin):
      list_display = ('title','position',) #顯示欄
      search_fields = ('title',) #搜索欄
      ordering = ('created_at',) #減號表示降序
      formfield_overrides = {TextField: {'widget': AdminMarkdownWidget}}
  
  admin.site.register(Post,PostAdmin)
  </code></pre>