Closed Okeanos closed 8 years ago
Will review it asap.
Any progress on this issue?
@Okeanos I had a lot of issues with having free time to support the extensions. Do you mind providing me sample code to duplicate the issue? Thanks in advance.
No worries. I'll see whether I can whip something up before the holidays.
It doesn't need to be too large, just replicating the issue. I have time now to support our extensions.
@Okeanos I pushed a fix, let me know if it works. Thanks.
This fix appears to be working. I don't have any test cases for the following wrapper classes, though, so I can't say whether the respective encode()
function also needs this treatment: FeatureGroup
, LayerGroup
, GeoJson
, Polygon
Thank you for taking care of it :)
@Okeanos Good news. I'll update revision tag then. I have plans to update the library to make it much better in structure.
I recently extended my existing map with polylines using the supplied wrapper class
dosamigos\leaflet\layers\PolyLine
. However, even when creating a perfectly fine Polyline:The resulting JS fails. This is because the current implementation of the encode function does not pass
JSON_NUMERIC_CHECK
onto theyii\helpers\Json::encode()
method used to transform theLatLng
object into JSON which results in string values instead of keeping the float values. This is also missing for Markers, however, in this case Leaflet itself appears to be more forgiving. Interestingly, for the map object itself the float values are kept as floats instead of being converted to strings even though the same process is used … maybe I am overlooking something?