Not a wish-list item but hints and tips

  • lesjar
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 3 weeks ago #13994 by lesjar
I had a problem where I wanted to add a map to 83 joomla pages. Each page is an Airport and as such the location of teh airport for each page will have different Latitude and Longitude co-ordinates. So what I did was very easy and so maintains the fact that each airport has a unique map so that perhaps other placemarks can be added on an individual basis if needed without a lot of coding if using just one map covering all 83 airports. So what I did was to create a base map and then clone this for all 83 airports , renaming the map according to the name of the airport. At this point i did not alter the template I will explain why later, So with 83 maps in place I then took the OPENSTREETMAP module and cloned it 83 times again re-naming to the name of the airport. Of course with the module you need to assign a map so this was done. At this stage I had 83 modules linked to 83 maps, I was thinking about how each map has most of the details the same and I found that only three items were different , Latitude, Longitude and footer text. Yes I could go back and forth to my airport table and then add the values in one by one but I thought that there is an easier way to be able to cut and paste from a text file as some data is a concatenation of several data items. It was a simple task to have a csv file with the key codes to my airport table. I used a php script to read the csv line by line and then go to my airport table and get the airport record , then I just created a text file for that airport that looks like the data you input to the module and map definitions in Joomla

Data for Zh OpenStreetMap for region is
Map Name EGS-EGILSSTADIR
Map Tab
Title EGS-EGILSSTADIR
Description
Latitude 65.283302307129
Longitude -14.401399612427
Width 600
Height 400
Map Details Tab
Show Title as Placemark Simple
Open Popup Yes
Disable AutoPan Yes
Close Popup when click on map Yes
Map Bounds
Zoom 11
Min Zoom Min Available Zoom
Max Zoom Max Available Zoom
Draggable Yes
Map Type OpenStreetMap
OpenStreetMap Layer Yes
Header Tab
Show Header Separator Yes
Footer Html Text heading 5
Text
Airport Map
Footer Tab
Show Footer Separator Yes
Footer Html Text heading 5
Text
EGILSSTADIR, IATA -: EGS, ICAO -: BIEG, Latitude -: 65.2833, Longitude -: -14.4014, Elevation -: 76
Page Layout EGS
Add Module Instance next to Airport Information
Rename to Airport Map
Pick a Module EGS-EGILSSTADIR

Above you can see an example of this so I can just cut and paste from the text file or follow my instructions as per adding items in joomla etc.

I hope this is of interest to any of you

Please Log in or Create an account to join the conversation.

Time to create page: 0.165 seconds
Powered by Kunena Forum