(If the map doesn’t appear you most likely haven’t installed the Openlayers library in the sites/all/libraries folder). On the map settings page you can set the maps default position, zoom & expose it as a block. Give it a suitable name and click continue. Set the layer type to be Vector and choose the source to be the views feed that you just created.Ĭontinue with the defaults until you have a completed layer. (In previous versions of OpenLayers you would create an OpenLayers Data layer – I’m not sure if this method still works however this is where my example differs from other tutorials.) OpenlayersĪdd a new layer, give it a suitable title and click continue. Make sure the display style for latitude and longitude is set to ‘Decimal Degrees’. Under Format settings, map the Fields to the Data Sources. Set the format to GeoJSON Feed and add in your fields for title, latitiude, longitude & description. Create a new view of content and add a display of a Feed. (How you get the lat/long is up to you, I’m using a map but you could Geocode this if needed.) Viewsģ. Setup a content type with location fields, the important part here is latitude & longitude. Install the Openlayers library (I’m using version 3.2.1) Content TypesĢ. (as well as any other required modules such as Views & CTools) Location, Gmap, Location Entity, Node Locations. Openlayers, Openlayers Block, Openlayers Block Switcher, OpenLayers Contextual Links, OpenLayers Examples, OpenLayers Geofield, OpenLayers Services, OpenLayers UI, OpenLayers Views.Feel free to re-use, copy, and modify the below: Modules After spending half a day working it out here are my step by step notes for creating a map based on latitude/longitude stored against a node using the location module. The new beta of the Openlayers module brings some much needed updates to the project though the way it works with views is a little different from the previous version.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |