@@ -304,8 +304,11 @@ def data_geojson(self):
304304 """Return the geo location as GeoJSON string.
305305 """
306306 features = []
307+ locations = self .locations
308+ count = len (locations )
309+ limit = self .settings .geojson_properties_limit
307310
308- for it in self . locations :
311+ for it in locations :
309312 if not it .longitude or not it .latitude :
310313 # these ``it`` are brains, so anything which got lat/lng
311314 # indexed can be used.
@@ -324,13 +327,14 @@ def data_geojson(self):
324327 }
325328 }
326329
327- props = IGeoJSONProperties (it .getObject (), None )
328- if getattr (props , 'popup' , None ):
329- feature ['properties' ]['popup' ] = props .popup
330- if getattr (props , 'color' , None ):
331- feature ['properties' ]['color' ] = props .color
332- if getattr (props , 'extraClasses' , None ):
333- feature ['properties' ]['extraClasses' ] = props .extraClasses
330+ if count < limit :
331+ props = IGeoJSONProperties (it .getObject (), None )
332+ if getattr (props , 'popup' , None ):
333+ feature ['properties' ]['popup' ] = props .popup
334+ if getattr (props , 'color' , None ):
335+ feature ['properties' ]['color' ] = props .color
336+ if getattr (props , 'extraClasses' , None ):
337+ feature ['properties' ]['extraClasses' ] = props .extraClasses
334338
335339 features .append (feature )
336340
0 commit comments