-
AuthorPosts
-
southsouthworld Friend
southsouthworld
- Join date:
- April 2017
- Posts:
- 257
- Downloads:
- 15
- Uploads:
- 56
- Thanks:
- 14
- Thanked:
- 4 times in 4 posts
August 29, 2017 at 7:18 am #1059109Hi Joomlart team,
Instead of having the center of the map be based on the last item’s coordinates I need one certain map on my Joomla site to have a fixed coordinate set as the center.
Link to map page is http://africa.southsouthworld.org/
I would like it to show all of Africa and be in the center.My situation is unique as africa map is one of 6 maps on my site (each linked to a different sub-domain)
Kindest regards,
Alyssasouthsouthworld Friendsouthsouthworld
- Join date:
- April 2017
- Posts:
- 257
- Downloads:
- 15
- Uploads:
- 56
- Thanks:
- 14
- Thanked:
- 4 times in 4 posts
August 29, 2017 at 11:54 am #1059190This reply has been marked as private.Luna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
August 30, 2017 at 10:52 am #1059446southsouthworld Friendsouthsouthworld
- Join date:
- April 2017
- Posts:
- 257
- Downloads:
- 15
- Uploads:
- 56
- Thanks:
- 14
- Thanked:
- 4 times in 4 posts
August 31, 2017 at 2:33 pm #1059700Many thanks Luna!
You are great.
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
September 1, 2017 at 2:46 am #1059776Hi.
You could try this.
Edit the file:
/plugins/system/jagooglemap/assets/script.jsLook for:
for(var i in locations.location) { var location = locations.location, latitude = locations.latitude.toFloat(), longitude = locations.longitude.toFloat(), info = locations.info, icon = null; if(typeof locations.icon != 'undefined') { icon = locations.icon; } if(this.isLatLon(latitude) && this.isLatLon(longitude)){ this.showLocation2(latitude, longitude, info, icon); }else{ this.showLocation(location, info); } }
Change to.
for(var i in locations.location) { var location = locations.location, latitude = locations.latitude.toFloat(), longitude = locations.longitude.toFloat(), info = locations.info, icon = null; if(typeof locations.icon != 'undefined') { icon = locations.icon; } if(this.isLatLon(latitude) && this.isLatLon(longitude)){ this.showLocation2(latitude, longitude, info, icon); }else{ this.showLocation(location, info); } centerPoint = new google.maps.LatLng(latitude,longitude); } var bounds = new google.maps.LatLngBounds(centerPoint); this.objMap.fitBounds(bounds);
southsouthworld Friendsouthsouthworld
- Join date:
- April 2017
- Posts:
- 257
- Downloads:
- 15
- Uploads:
- 56
- Thanks:
- 14
- Thanked:
- 4 times in 4 posts
September 4, 2017 at 6:45 pm #1060283Hi Moonlight,
I made the changes and the map stopped working… Could you please kindly check for me to see why the code is not working.
Kindest regards,
Alyssasouthsouthworld Friendsouthsouthworld
- Join date:
- April 2017
- Posts:
- 257
- Downloads:
- 15
- Uploads:
- 56
- Thanks:
- 14
- Thanked:
- 4 times in 4 posts
September 4, 2017 at 6:52 pm #1060284Many thanks in advance for your help, look forward to hearing from you.
Kindest regards, Alyssa
- This reply was modified 7 years, 2 months ago by southsouthworld.
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
September 6, 2017 at 3:36 am #1060637Hi.
I edited the file:
/plugins/system/jagooglemap/assets/script.jsAdd the code.
this.objMap.setCenter({lat: latitude, lng:longitude });
southsouthworld Friendsouthsouthworld
- Join date:
- April 2017
- Posts:
- 257
- Downloads:
- 15
- Uploads:
- 56
- Thanks:
- 14
- Thanked:
- 4 times in 4 posts
September 6, 2017 at 10:28 am #1060747Thanks, Moonlight, will this mean all the maps will have the same center? I have 6 maps on the site, and only one map I would like to have a specific center point.
Another solution would be to base the center point of the map on the middle average point of all the map markers displayed on the map.
Kindest regards,
Alyssa- This reply was modified 7 years, 2 months ago by southsouthworld.
- This reply was modified 7 years, 2 months ago by southsouthworld.
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
September 8, 2017 at 2:22 am #1061102Hi.
I edited the same file.
add the code.
if (window.location.host == 'africa.southsouthworld.org')
You could change the host by the name you want.
southsouthworld Friendsouthsouthworld
- Join date:
- April 2017
- Posts:
- 257
- Downloads:
- 15
- Uploads:
- 56
- Thanks:
- 14
- Thanked:
- 4 times in 4 posts
September 8, 2017 at 5:51 am #1061142Many thanks Moonlight so at the bottom of the code I add:
if (window.location.host == ‘africa.southsouthworld.org’)
this.objMap.setCenter({lat: latitude, lng:longitude });Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
September 8, 2017 at 10:09 am #1061172Hi.
I already add the code.
You don’t have to do it.You could change the host "africa.southsouthworld.org" to any host you want.
1 user says Thank You to Mo0nlight for this useful post
-
AuthorPosts
This topic contains 11 replies, has 3 voices, and was last updated by Mo0nlight 7 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum