1

我可以在我当前的项目中使用第三维,这强烈涉及 google-maps 和 django。我该如何处理?

class Waypoint(models.Model):
    latlng = models.PointField()

>>> p = Point( 5, 10, 20)
<Point object at Ox...>
>>> p.kml
'<Point><coordinates>5.0,10.0,20.0</coordinates></Point>'
>>> w = Waypoint.objects.all()[0]
<Waypoint: Waypoint object>
>>> w.latlng = p
>>> w.latlng.kml
'<Point><coordinates>5.0,10.0,20.0</coordinates></Point>'
>>> w.save()
>>> w = Waypoint.objects.all()[0]
<Waypoint: Waypoint object>
>>> w.latlng.kml
'<Point><coordinates>5.0,10.0,0</coordinates></Point>'
                              ^

请注意,忽略第三个 diemsnion。GRRR!

4

0 回答 0