Closed (fixed)
Project:
Leaflet
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Sep 2012 at 18:37 UTC
Updated:
2 Dec 2013 at 18:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gumdal commentedHi,
I have been trying to draw KML polygons on the map. I do not know how or why am not at all able to get it draw on the map. Please share with me about how to do it? Or if you have any guide and steps to do it will be helpful.
Comment #2
arcsump commentedHi!
Just opened leaflet.drupal.js
The way i see it it is not implemented as desired?
hunted the codes for that.
Hope this helps:
Comment #3
rdeboerIt works if you enter your MultiPolygon as a MultiLineString, which in the current code are treated equally, in that Leaflet closes the MultiLineString (thus turning it into a polygon) and then fills in the area with a blue shading, as is common for a polygon.
The example in pont 3 above thus becomes:
Note that a MultiLineString doesn't have the extra pair of enclosing brackets for each of its LineStrings, whereas a MultiPolygon does.
Comment #4
mgiffordAny progress on this issue?
Comment #5
dshields commentedI guess the solution in #3 works (haven't tested it yet), but what I'm looking to do is use geofield to generate this data from another field, a file field that holds a kml file..
Can anyone provide a solution on how to change the "MultiPolygon" to a "MultiLineString" and alter the brackets accordingly when using geofield's "Geocode from another field" feature, as described here: https://drupal.org/node/1980360?
Comment #6
dshields commentedLooks like this one has really stalled.
Comment #7
balagan commentedI have enclosed a patch for this. It is working for me with the given geoJSON string.
Comment #8
balagan commentedI have just noticed, that an if-else statement is not necessary, since there is no fallthrough in the switch anymore. I have corrected the patch accordingly.
Comment #9
balagan commentedAnother patch got committed into this file, so I will have to reroll the patch.
Comment #10
balagan commentedI have attached the rerolled patch.
Comment #11
gcbGreat patch @balagan, thanks. Much cleaner separating out the switch statements for those different element types, too. Committed to Dev, look for it in the upcoming release.
Comment #12
balagan commentedComment #13
gcbhttps://drupal.org/node/2148175