Hi,
I am new to Drupal and I wanted to display KML polygon overlay on maps. The KML's polygon overlay should be editable and the updates should be maintained. I could achieve the same using OpenLayer's native fields which gives me Polygon something like this:
POLYGON ((73.388681037812 19.112484040461, 73.608407600313 17.107729704053, 74.619149787812 14.060401771206, 75.498056037818 12.263265526929, 76.508798225317 9.9347768243063, 77.080087287813 9.6316334577929, 73.388681037812 19.112484040461))
polygon
14.109
75.0462
73.3887
19.1125
77.0801
9.63163
I instead wanted to go with KML file. So I tried out OpenLayers KML Layer. I tried a lot but I could not configure it properly so that my site could read the KML file and display its contents on the map. There is no definitive guide on how exactly to integrate it into the website.
Basically am not able to perform the 2nd step mentioned in configuration:
"Visit /admin/build/openlayers/layers/openlayers_kml_layer and select which filefields in each content type are KML files."
I also tried Geofile which also promises of showing the KML overlay on map, but unfortunately could not get it to work either.
I need help here guys, about how to add OpenLayers KML layer into project, and whether my requirements would be served with the module I am trying to integrate?
Also, is it possible that registered user would be modifying KML file using OpenLayer and the same is revision controlled too?
Thanks for any suggestions and pointers.
Raj
Comments
I don't know about displaying
I don't know about displaying polygons, because I have not tried it, but with kml tracks you can go to
admin/structure/openlayers/layers/add/openlayers_layer_type_kmlto add a layer there. You then add the layer you created to a map display.
Try and try till you die!
Fine, I had added a layer using the "OpenLayer KML Layer" as you have said. Next I went into Views and added a view. Configured the following:
1. In Format:
a. Field -> The content field which contains my KML file.
b. OpenLayers preset -> Geofile formatter Map
c. OpenLayers layer -> KML.
2. Fields:
I removed all other fields and added only that field which has the KML file.
But the preview does not show the layer on map yet.
So, I tried to configure map display:
structure -> OpenLayers -> Add
And added new map display by using the layer which I just created (as you had earlier said).
Next, I added a field in the content with GeoField and the widget set to -> "Openlayers Map". I assume that since the View is setup to display the kml file using the field which contains my kml, and also because the layer is added in the map's display, it should ideally draw the kml overlay on the map. I can see nothing unfortunately. I dont know where I am going wrong.
Raj Pawan G
www.rkmission-shivanahalli.org
This may
This may help...
http://drupal.org/node/1481374
I'm attempting to do the
I'm attempting to do the same. The guide to OpenLayers hasn't been productive though - the polygon simply isn't appearing on the map.
Any ideas?
I don't actually use polygons
I don't actually use polygons on my site so I am a bit out of my depth here.
When setting up a kml layer (a track with point markers), I prepare the kml file in Google Earth and then upload it to the server, copying its file location. I then create a kml layer directly on OpenLayers and enter the file location. I then add that layer to a map display.
Could fix it
Sorry for a late reply, I lost track of notifications.
I could fix it almost the same way as @Patroclas mentioned. Forget creation of KML in Openlayers for the following reason:
So am doing the same as @Patroclas suggested. I have a central Google account to manage KML files. Our community creates, updates KML files using the same account and uses that KML file to upload and then we just render the KML on map using openlayers. But am not using "Openlayer KML layer" module for it.
To achieve this, do the following
That's it, we dont have to add an extra layer, Geofile will itself add the layer, I guess?
Raj Pawan G
www.rkmission-shivanahalli.org