Comments (8)
You'll need these dependencies. They are there for a reason.
Solution: Install GEOS. Review the documentation for your operating system.
If on Windows, I recommend OSGEO4W Installer.
On Wed, Jan 28, 2015 at 12:35 PM, V1ce [email protected] wrote:
Hi,
I got a problem, i can't add marker to map with my current code, he works
well some week ago, but with no reason and no edit code it just stop to
work, dt understand...
- latest stable version of django-leaflet and django-geojson
- django 1.7.4
- Python 3.4
It's just a basic call :
models.py :
class lieu(models.Model):
nom = models.CharField(max_length = 30, null = True)
geom = GeometryField()
description = models.TextField(null = True)
categorie = models.ForeignKey('categorie', null=True, blank=True)
def str(self):
return self.nomurls.py
url(r'^map/(?P\w+)/?$', getlieux.as_view(),name='getlieu'),
views.py
class getlieux(GeoJSONLayerView):
model = lieu
#properties=('popupContent',)
def get_queryset(self):
return lieu.objects.filter(categorie__nom=self.kwargs['categ'])javascript :
$('.rem').click(function() {
categ = $(this).text();
$.getJSON('/map/' + categ + '/', function (data) {
marker.addData(data);
});
});
I got this with the ajax request, thats looks normal answer :
{"type": "FeatureCollection", "features": [{"properties": {"model":
"plan.lieu"}, "type": "Feature", "id": 12, "geometry": {"type": "Point",
"coordinates": [0.17282545566558838, 47.282842764549855]}}], "crs":
{"properties": {"href": "http://spatialreference.org/ref/epsg/4326/",
"type": "proj4"}, "type": "link"}}At the install of django-geojson i got geos error dependency, so cant load
template, i comment these lines in djgeojson/views.py (thx fle post about
this) :#from django.contrib.gis.geos.geometry import Polygon
#from django.contrib.gis.db.models import PointFieldAnd after that i can load my templates correctly, i dont think that provoc
my problem because my code works some week ago with these line commented...i got an other random error like this :
At my first install of leaflet and djgeojson, i was able to create a point
field in django-admin with the leaflet widget admin, but can't edit it, the
leaflet.js just freeze my web browser (firefox or chrome), but works with
other geometry field. And in a day, without touch anything in the code,
without update etc i was able to edit my point field, from this moment i dt
got this error anymore.Thanks for your answer and enjoy my bad english :p
—
Reply to this email directly or view it on GitHub
#51.
George R. C. Silva
SIGMA Consultoria
http://www.consultoriasigma.com.br/
from django-geojson.
thx but why i was able to use django-geojson without spatial dependencies few time ago and with the same version?
from django-geojson.
Leaflet is a client library that runs on the browser, not server.
What I mean here is that there is no bug on django-geojson code. You need
the dependencies for the code work properly.
On Wed, Jan 28, 2015 at 12:44 PM, V1ce [email protected] wrote:
thx but why i was able to use leaflet without spatial dependencies few
time ago?—
Reply to this email directly or view it on GitHub
#51 (comment)
.
George R. C. Silva
SIGMA Consultoria
http://www.consultoriasigma.com.br/
from django-geojson.
Problem resolv without geos or postgis.
Just forgot to initialyze my layer in the map_init function
function map_init(map, options) {
var collection ;
#before :/
L.geoJson(collection, {onEachFeature: onEachFeature}).addTo(map);
#now :)
layer = L.geoJson(collection, {onEachFeature: onEachFeature}).addTo(map);
}
and i can now add data to him
$('.rem').click(function(e) {
categ = $(this).text();
$.getJSON('/map/' + categ + '/', function (data) {
layer.clearLayers()
layer.addData(data);
});
});
2 day for that :p
from django-geojson.
Please close this issue if there is nothing we have to do :)
from django-geojson.
Hi,
I re-open this issue about this 2 lines i have commented in djgeojson/views.py, so with that no need geos :
#from django.contrib.gis.geos.geometry import Polygon
#from django.contrib.gis.db.models import PointField
Actually thats work fine for my use, just click in a link and some points pop in the map. But i want to know if these 2 lines can provoc some problems in the future?
At this http://fle.github.io/easy-webmapping-with-django-leaflet-and-django-geojson.html Fle say :
"The magic thing is that you don't need a spatial database or some complex geographic libraries! Mathieu and I have removed the last dependencies to GEOS a few days ago. I'm glad I could make this tiny contribution!"
Can i really continue to use Django-geojson without geos?
Thanks :)
from django-geojson.
What is your problem exactly ?
Yes, we want to continue to support django-geojson without GEOS. If you have a particular problem, just tell us :)
from django-geojson.
Hi,
No problem at this time, just want know if i can continu with these pratices. Thanks
from django-geojson.
Related Issues (20)
- UWSGI crashes after installing django-geojson HOT 2
- 'Shop' object has no attribute 'geom'
- JSONFormField is removed from jsonfield HOT 1
- Leaflet widget is not rendered automatically for forms.Forms HOT 4
- Generate FeatureCollection GeoJSON from queryset in the database
- Daes it make sense to improve validators process? HOT 2
- jsonfield dependency still required? HOT 1
- Error creating geometry from value 'null' (String input unrecognized as WKT EWKT, and HEXEWKB.) HOT 2
- Make 'name' the default for 'crs_type' HOT 3
- Leaflet warning when using own widget HOT 1
- Broken link in documentation HOT 1
- Problems running the test suite locally HOT 7
- 'Serializer' object has no attribute 'deserialize' HOT 6
- GeoJSONLayerView and LoginRequiredMixin HOT 5
- Django 2.0: AttributeError: 'CharField' object has no attribute 'rel' HOT 3
- How I Can Add Circle Support In Geometry Type HOT 1
- Support Model methods with no parameters HOT 1
- Serving geoJson with custom coordinates HOT 1
- Makemigrations Failing - Could not find GDAL. HOT 1
- Object has no attribute 'geom' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-geojson.