-
AuthorPosts
-
May 18, 2017 at 11:47 am #1035051
I have found where to add my code for that but I need the plugin override to work. So I have the following questions:
1) Can you let me know how I can make this work?
2) Do you happen to have an idea on how to extend the JAWidgetMap class and add a new method in the view file instead of having to mess with the script.js file itself?
3) Where can I set a default address when the map loads for the first time?Thank you
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
May 19, 2017 at 8:46 am #1035361Hi
I’m looking at this, pls stay tuned.
May 19, 2017 at 2:07 pm #1035442Sorry, I have a 4th question:
On a multiple location map, when I click on a marker I see the info box. The problem I spotted is when I don’t close up this box and simply click on another marker. I also get its box opened so in my map I end up having all info boxes open if I don’t chose to close them up from the x button.
How can I change that so when I click on each marker to just close the previous one and open the one I clicked?Here is an example: http://maps.marnoto.com/en/multiple-markers/example.html
Thank you
YiotaMay 22, 2017 at 11:38 am #1036021Any news on the above please?
Thank you
YiotaAnonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
May 29, 2017 at 3:27 am #1037631Hi.
- If you want to center the map with all the pointer inside. Edit the file : /plugins/system/jagooglemap/assets/script.js
Look 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); } LatLngList.push(new google.maps.LatLng (latitude,longitude)); }
Change to :
var LatLngList = new Array (); 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); } LatLngList.push(new google.maps.LatLng (latitude,longitude)); } // Create a new viewpoint bound var bounds = new google.maps.LatLngBounds (); // Go through each... for (var i = 0, LtLgLen = LatLngList.length; i < LtLgLen; i++) { // And increase the bounds to take this point bounds.extend (LatLngList); } // Fit these bounds to the map this.objMap.fitBounds (bounds);
-
Extend class JAWidgetMap. This one required heavy knowledge of program language. You should hire a programmer if you want to edit the plugin. You can see this link if you want to find out your self. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/extends
-
I’m not entirely sure of what you want here, could you clarify it a bit more details?
- If you want to show only 1 detail info box at the time. Edit the file: /plugins/system/jagooglemap/assets/script.js
Look for :
var infowindow = new google.maps.InfoWindow({
Change to :
infowindow = new google.maps.InfoWindow({
Add this :
var infowindow;
Above this :
JAWidgetMap = new Class({
May 30, 2017 at 7:03 am #1037984Hello,
Ideally I would like the plugin override to work so I won’t need to mess up with the core plugin and the script.js file.
My plan was to extend the JAWidgetMap in that override and add/call my new method for the map without messing up with the core script.js file.
Is there a way to do that?
Do you know why the plugin override is not working?Thank you
YiotaMo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
June 1, 2017 at 2:59 am #1038655Hi.
As i mentioned above
Extend class JAWidgetMap. This one required heavy knowledge of program language. You should hire a programmer if you want to edit the plugin. You can see this link if you want to find out your self. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/extends
That all i could help you in this problem.
June 2, 2017 at 7:47 am #1038973OK the class extend part was clear enough but I am asking why the plugin override is not working. Do you have an answer about that please?
Thank you
YiotaMo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
June 6, 2017 at 2:55 am #1039793Hi.
You could see this link for more info : https://docs.joomla.org/Understanding_Output_Overrides
And i don’t think joomla support plugin override.
June 8, 2017 at 3:24 pm #1040738https://docs.joomla.org/Layout_Overrides_in_Joomla#Plugin_Alternative_Layouts_.28Overriding_a_Plugin.29
plus your code suggests so
function getLayoutPath($plugin, $layout = 'default') { $app = JFactory::getApplication(); // Build the template and base path for the layout $tPath = JPATH_BASE . '/templates/' . $app->getTemplate() . '/html/' . $plugin->name . '/' . $layout . '.php'; $bPath = JPATH_BASE . '/plugins/' . $plugin->type . '/' . $plugin->name . '/tmpl/' . $layout . '.php'; // If the template has a layout override use it if (file_exists($tPath)) { return $tPath; } elseif (file_exists($bPath)) { return $bPath; } return ''; }
Thank you
-
AuthorPosts
This topic contains 13 replies, has 3 voices, and was last updated by yiotaz 7 years, 6 months ago.
The topic ‘JA Maps and search integration’ is closed to new replies.