Guest
04 May 2013 03:15

Hi,

I have some issues with the google map view. I am using the rockettheme and the problem with me is when you switch view for google map. The google map is showing only the numbers of records on the map, however when I click the number on the map, it expands, expands and does not show any of the article fields value.

Here is the link:

http://www.oriyaboard.com/dreamhomet/forsale/items/15-seller-section.html

Another question is , can anybody shed any lights, for example: if I need to show the streetviews in a tab and neighbourhood nearby places (for example if I need to show nearby school, nearby hospital etc etc) in the record full view, how can I do? For example in the following link:

http://www.oriyaboard.com/dreamhomet/forsale/item/7-listing-by-agents/9-6-bedrooms-for-sale- %C2%A37800.html

And the last question is : is it possible to show an ajax address search field (like jreviews) in the cobalt module filter, where users will enter UK post code, address with google custom search?

Last Modified: 02 Mar 2014


Sackgesicht VIP
Total posts: 1,636
04 May 2013 03:36

Brian,

the display of "numbers" is the MarkerClusterer functionality.

See an extensive explanation here

If you have only few markers, i would suggest to disable the MarkerClusterer in the map template configuration. (Enable clusterer --> No)

For MintJoomla:

**Btw, it would be good to provide 3 parameters to define the behaviour of the MarkerClusterer --> Zoomlevel, Clustersize and maybe ClusterStyle

**

The other 2 questions are just in discussion in other topic(s).


Guest
04 May 2013 03:45

Hi Sackgesicht ,

Thanks million for your very quick response. I must appreciate for your time spending even in the weekend.Thanks once more time.

I disabled the clusterer, but now I dont see any mark on the map for all the records. Am I missing anything here?

Thanks

Biren


Sackgesicht VIP
Total posts: 1,636
04 May 2013 04:10

Brian,

please double check your "Icons set source folder:" settings in your geo field settings.

Your site gives an error when trying to locate the marker.

Double check your marker setting in the field settings and make sure that you copied your individual markers (if you want to use some) into the right folder.


Guest
04 May 2013 04:37

Hi Sackgesicht ,

I now changed to google marker and still no luck. I can access the marker on the url as:

http://www.oriyaboard.com/dreamhomet/components/com_cobalt/fields/geo/markers/google/markerZ.png

But somehow the name is not caught by the program. Still struggling.

Brian


Sackgesicht VIP
Total posts: 1,636
04 May 2013 04:56

Did you resave the articles? It still shows the same error message ....

In your mal list template, disable "show marker loading" -- it just slows down the whole thing ...


Guest
04 May 2013 07:30

You are a lifesaver, my friend. Yes it is working now.


Sergey
Total posts: 13,748
06 May 2013 01:36

if I need to show the streetviews in a tab and neighbourhood nearby places (for example if I need to show nearby school, nearby hospital etc etc) in the record full view, how can I do?

I am not sure if this is possible. It is hard to automatically detect nearby school or store. And street view have to be positioned also to initialize to look in front of building. I do not know how to make that to frank.

if I need to show the streetviews in a tab and neighbourhood nearby places (for example if I need to show nearby school, nearby hospital etc etc) in the record full view, how can I do?

is it possible to show an ajax address search field (like jreviews) in the cobalt module filter, where users will enter UK post code, address with google custom search?

Not exactly sure what you mean. Can you show a screenshot?


Guest
06 May 2013 02:20

I am not sure if this is possible. It is hard to automatically detect nearby school or store. And street view have to be positioned also to initialize to look in front of building. I do not know how to make that to frank.

I have tried to get it done, but am stuck at one point. Let me explain what I did. I tried to use walkscore java script as done in the following url:

http://osproperty.ext4joomla.com/index.php/property/for-lease/Rodeway-Inn-Convention-Center.html

what I did is I created an HTML Field and inside there, I placed walkscore generated javascript. But the problem with this is the location/address field which is static. I just placed manually the address field (var ws_address = 'sm25he';)as below:

<script type='text/javascript'>

var ws_wsid = 'wsid';

var ws_address = 'sm25he';

var ws_width = '700';

var ws_height = '540';

var ws_layout = 'horizontal';

var ws_hide_footer = 'true';

var ws_commute = 'true';

var ws_transit_score = 'true';

var ws_show_reviews = 'true';

var ws_map_modules = 'default';

var ws_no_link_info_bubbles = 'true';

var ws_no_link_score_description = 'true';

</script><style type='text/css'>#ws-walkscore-tile{position:relative;text-align:left}#ws-walkscore-tile *{float:none;}#ws-

footer a,#ws-footer a:link{font:11px/14px Verdana,Arial,Helvetica,sans-serif;margin-right:6px;white-

space:nowrap;padding:0;color:#000;font-weight:bold;text-decoration:none}#ws-footer a:hover{color:#777;text-

decoration:none}#ws-footer a:active{color:#b14900}</style><div id='ws-walkscore-tile'></div><script type='text/javascript' 

src=' http://www.walkscore.com/tile/show-walkscore-tile.php '></script>

I have also another user input geo field in the same section/Type. The issue is I dont know how to get the address value from the geo field and place it inside the javascript. There may be a way to do thia. Once thiis is done, you can directly see the actual walkscore implemented inside template which changes as per user input, which is dynamic.

Any idea how to do?

Kind Regards

Brian


Sergey
Total posts: 13,748
06 May 2013 04:15

I am not sure how this script works but you can get address if you want or even lat/long from the field.

$item->fields_by_id[10]->value

Where 10 is an Id of the field ans value is an array of data. Just print_r it for details.


Guest
06 May 2013 04:23

Hi Sergey,

Thanks for your quick reply.

Do you have any idea how can I call this inside the java script in html field?


Sergey
Total posts: 13,748
06 May 2013 04:28
fields_by_id[10]->value['address']['city']; ?> var ws_wsid = 'wsid'; var ws_address = ''; var ws_width = '700'; var ws_height = '540'; var ws_layout = 'horizontal'; var ws_hide_footer = 'true'; var ws_commute = 'true'; var ws_transit_score = 'true'; var ws_show_reviews = 'true'; var ws_map_modules = 'default'; var ws_no_link_info_bubbles = 'true'; var ws_no_link_score_description = 'true';

Somethign like this but you have to put it into te field template. To list template foe example

This is in list template

$address = $item->fields_by_id[10]->value['address']['city'];

In geo field template

$address = $this->value['address']['city'];


Guest
06 May 2013 07:39

Hi Sergey,

Thanks for ur reply. I tried as suggested above, still no luck. I tried with TINYMce and CodeMirror and still no luck. This would be a great if I could implement this.

Brian


Sergey
Total posts: 13,748
06 May 2013 09:56

Thanks for ur reply. I tried as suggested above, still no luck. I tried with TINYMce and CodeMirror and still no luck. This would be a great if I could implement this.

this will not work in any HTML editor. You have to edit PHP fieles. Eitherr list template or geo field output template.

Please read more about this


Guest
07 May 2013 05:27

this will not work in any HTML editor. You have to edit PHP fieles. Eitherr list template or geo field output template.

Let me work on it and then I will come back to you. I will also encourage others to use this as this is a greatway to show your customers neighbourhood locations to your customers near the location.


Guest
10 May 2013 07:37

Hi Sergey,

As advised by you, I made changes to the php files in geo output template, but still had no luck.

Here is what I put in geo output template.


<?php $address = $item->fields_by_id[10]->value['address']['city']; ?> <script type='text/javascript'> var ws_wsid = 'wsid'; var ws_address = '<?php $address ?>'; var ws_width = '700'; var ws_height = '540'; var ws_layout = 'horizontal'; var ws_hide_footer = 'true'; var ws_commute = 'true'; var ws_transit_score = 'true'; var ws_show_reviews = 'true'; var ws_map_modules = 'default'; var ws_no_link_info_bubbles = 'true'; var ws_no_link_score_description = 'true'; </script> <?php /** * Cobalt by MintJoomla * a component for Joomla! 1.7 - 2.5 CMS ( http://www.joomla.org ) * Author Website: http://www.mintjoomla.com/ * @copyright Copyright (C) 2012 MintJoomla ( http://www.mintjoomla.com ). All rights reserved. * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html */ defined('_JEXEC') or die(); $out = $contacts = $links = $address = array(); $client = ($client == 'list') ? 1 : 2; $links = JFormFieldCgeo::getAditionalinks(); $contacts = JFormFieldCgeo::getAditionalFields(); $address = JFormFieldCgeo::getAddressFields(); $app = JFactory::getApplication(); $address = $this->value['address']['city']; if($this->request->get('func') == 'onInfoWindow') { $this->params->set('params.map_view',0); } if(in_array($this->params->get('params.adr_view'), $this->user->getAuthorisedViewLevels())):?> <?php if(! empty($this->value['address'])): $a = array(); ArrayHelper::clean_r($this->value['address']); foreach($this->value['address'] as $name => $link) { if($name == 'country') { $this->value['address'][$name] = $this->_getcountryname($link); } if(! in_array($this->params->get("params.address.{$name}.show", 3), array($client, 3))) unset($this->value['address'][$name]); } if(! empty($this->value['address']['company'])) { $a[] = '<strong>' . $this->value['address']['company'] . '</strong><br>'; $mecard['n'] = 'N:' . $this->value['address']['company']; unset($this->value['address']['company']); } elseif(! empty($this->value['address']['person'])) { $a[] = '<strong>' . $this->value['address']['person'] . '</strong><br>'; $mecard['n'] = 'N:' . $this->value['address']['person']; unset($this->value['address']['person']); } if(! empty($this->value['address'])) { $this->value['address'] = array_reverse($this->value['address']); $a[] = implode(", ", $this->value['address']); $mecard[] = 'ADR:' . implode(", ", $this->value['address']); } endif; if(! empty($this->value['contacts'])): $c = array(); ArrayHelper::clean_r($this->value['contacts']); foreach($this->value['contacts'] as $name => $contact) { if(empty($contacts[$name])) continue; if(! in_array($this->params->get("params.contacts.{$name}.show", 3), array($client, 3))) continue; $text = $contact; if(! empty($contacts[$name]['patern'])) { $text = str_replace(array('[VALUE]', '[NAME]'), array($contact, JText::_($contacts[$name]['label'])), $contacts[$name]['patern']); } $c[] = '<abbr title="'.JText::_($contacts[$name]['label']).'" rel="tooltip" data-original-title="'.JText::_($contacts[$name]['label']).'"> <img src="'.str_replace(array('[VALUE]', '[NAME]'), array($contact, JText::_($contacts[$name]['label'])), $contacts[$name]['icon']).'"> '.JString::substr(JText::_($contacts[$name]['label']), 0, 1).':</abbr> '.$text; } endif; if(! empty($this->value['links'])) : $l = array(); ArrayHelper::clean_r($this->value['links']); foreach($this->value['links'] as $name => $link) { if(! in_array($this->params->get("params.links.{$name}.show", 3), array($client, 3))) continue; if(in_array(trim($link), array('http://', 'http:'))) continue; $l[] = '<abbr title="'.JText::_($links[$name]['label']).'" rel="tooltip" data-original-title="'.JText::_($links[$name]['label']).'"> <img src="'.$links[$name]['icon'].'">'.JString::substr(JText::_($links[$name]['label']), 0, 1).':</abbr> <a rel="nofollow" target="_blank" href="'.$link.'">'.($this->params->get('params.links_labels') ? $link : JText::_($links[$name]['label'])).'</a>'; } ?> <?php endif; ?> <?php if($a || $c || $l): ?> <address> <?php if($a): ?> <?php echo implode("\n", $a);?> <br><br> <?php endif;?> <?php if($c): ?> <?php echo implode("<br>", $c);?> <br> <?php endif;?> <?php if($l): ?> <?php echo implode("<br>", $l);?> <?php endif;?> </address> <?php endif;?> <?php endif; if(in_array($this->params->get('params.qr_code_address'), array($client, 3))): $w = $this->params->get('params.qr_width_address', 250); if(! empty($this->value['contacts']['mob'])) { $mecard[] = 'TEL:' . $this->value['contacts']['mob']; } elseif(! empty($this->value['contacts']['tel'])) { $mecard[] = 'TEL:' . $this->value['contacts']['tel']; } elseif(! empty($this->value['contacts']['fax'])) { $mecard[] = 'TEL:' . $this->value['contacts']['fax']; } if(! empty($this->value['links']['web'])) { $mecard['url'] = 'URL:' . $this->value['links']['web']; } elseif(! empty($this->value['links']['facebook'])) { $mecard['url'] = 'URL:' . $this->value['links']['facebook']; } elseif(! empty($this->value['links']['twitter'])) { $mecard['url'] = 'URL:' . $this->value['links']['twitter']; } elseif(! empty($this->value['links']['google'])) { $mecard['url'] = 'URL:' . $this->value['links']['google']; } elseif(! empty($this->value['links']['youtube'])) { $mecard['url'] = 'URL:' . $this->value['links']['youtube']; } if(empty($mecard['url']) && ! empty($this->value['links'])) { $mecard['url'] = 'URL:' . array_shift($this->value['links']); } if($mecard['url'] == 'URL:http://') { unset($mecard['url']); } if(!empty($mecard) && $this->email) { $mecard[] = 'EMAIL:' . $this->email; } if(!empty($mecard)) : $url = ' http://chart.apis.google.com/chart?cht=qr& ;chs=' . $w . 'x' . $w . '&chl=MECARD:' . implode(';', $mecard) . ';;'; ?> <div class="qr-image qr-image-address"><?php echo JHtml::image($url, JText::_('G_ADDRESSQR'), array('width' => $w, 'height' => $w));?></div> <?php endif;?> <?php endif; if(in_array($this->params->get('params.map_client'), array($client, 3)) && in_array($this->params->get('params.map_view'), $this->user->getAuthorisedViewLevels()) && !empty($this->value['position']['lat']) && !empty($this->value['position']['lng'])) : $params = new JRegistry($this->value['position']); list($icon_w, $icon_h, $icon) = $this->getMarker(); $icon_m = round($icon_w / 2); ?> <?php echo $this->_title(JText::_('G_MAP'), $client);?> <style> #map_canvas_<?php echo $record->id;?>_<?php echo $this->id;?> label { width: auto; display:inline; } #map_canvas_<?php echo $record->id;?>_<?php echo $this->id;?> img { max-width: none; } </style> <div id="map_canvas_<?php echo $record->id;?>_<?php echo $this->id;?>" style="width:<?php echo $this->params->get('params.map_dwidth', '100%');?>; height:<?php echo $this->params->get('params.map_dheight', '200px');?>"></div> <script type="text/javascript"> function initialize_<?php echo $record->id;?>_<?php echo $this->id;?>() { var msize = new google.maps.Size(<?php echo $icon_w;?>,<?php echo $icon_h;?>); var mpoint = new google.maps.Point(<?php echo $icon_m;?>,<?php echo $icon_h;?>); var markerIcon = new google.maps.MarkerImage('<?php echo $icon;?>', msize, new google.maps.Point(0,0), mpoint); var myLatlng = new google.maps.LatLng(<?php echo $params->get('lat');?>, <?php echo $params->get('lng');?>); var map<?php echo $record->id.$this->id;?> = new google.maps.Map(document.getElementById("map_canvas_<?php echo $record->id;?>_<?php echo $this->id;?>"), {zoom:<?php echo $params->get('zoom', 15);?>,center:myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP, draggable:0, scrollwheel:0}); <?php if($this->params->get('params.map_style')):?> var mapStyle = <?php echo JFile::read(JPATH_ROOT . DIRECTORY_SEPARATOR . 'components/com_cobalt/library/js/mapstyles/' . $this->params->get('params.map_style'));?>; map<?php echo $record->id.$this->id;?>.setOptions({styles: mapStyle}); <?php endif; ?> new google.maps.Marker({position: myLatlng, map: map<?php echo $record->id.$this->id;?>, icon: markerIcon}); var id = jQuery('#map_canvas_<?php echo $record->id;?>_<?php echo $this->id;?>').parents('div.tab-pane').attr('id'); if(id) { jQuery('a[href*="' + id + '"]').one('click', function(){ setTimeout(function(){ google.maps.event.trigger(map<?php echo $record->id.$this->id;?>, 'resize'); map<?php echo $record->id.$this->id;?>.setCenter(myLatlng); }, 100); }); } jQuery('#map_canvas_<?php echo $record->id;?>_<?php echo $this->id;?>').one('mouseenter', function(){ setTimeout(function(){ google.maps.event.trigger(map<?php echo $record->id.$this->id;?>, 'resize'); map<?php echo $record->id.$this->id;?>.setCenter(myLatlng); }, 100); }); google.maps.event.addListenerOnce(map<?php echo $record->id.$this->id;?>, 'mouseover', function(event) { google.maps.event.trigger(map<?php echo $record->id.$this->id;?>, 'resize'); }); } initialize_<?php echo $record->id;?>_<?php echo $this->id;?>(); </script> <?php endif; if(in_array($this->params->get('params.qr_code_geo'), array($client, 3)) && isset($this->value['position']['lat']) && isset($this->value['position']['lng']) && $this->value['position']['lat'] && $this->value['position']['lng']): $w = $this->params->get('params.qr_width_geo', 120); $url = ' http://chart.apis.google.com/chart?cht=qr& ;chs=' . $w . 'x' . $w . '&chl=geo:' . $this->value['position']['lat'] . ',' . $this->value['position']['lng']; ?> <div class="qr-image qr-image-geo"><?php echo JHtml::image($url, JText::_('G_LOCATIONQR'), array('width' => $w, 'height' => $w));?></div> <?php endif;

Am I going to put in geo output template as well as inside /components/com_cobalt/views/record/tmpl/default_record_* file?

Sergey, This would be a great addition to your customers as this has got loads of map options, like street view, neightbourhood info etc etc... I am sure lots of people might have similar requirements. It would be good to integrate this in Cobalt.

Thanks

Brian


Sergey
Total posts: 13,748
10 May 2013 07:47

This is field output template. There you have to get

$address = $this->value['address']['city'];


Guest
10 May 2013 07:58

This is field output template. There you have to get

$address = $this->value['address']['city'];

Sergey, I put that in output template, it still does not display. Do I need to put the java script inside JS folder? or inside the output template?


Sergey
Total posts: 13,748
10 May 2013 08:03

I think file you posted here is

fields/geo/output/default.php

This is good location. But not at very top of course you need to place it somewhere at the end of document.

Also piece of code you add does not do anything. So i do not know what you expend it to show. It only declare variables. In your earlier examples you have some HTMl and other JS code.


Guest
13 May 2013 04:23

Hidden text


Sergey
Total posts: 13,748
13 May 2013 04:57

I am sure if you post your project on site something like Joomlancers.com you will quickly ind someone who will help.

Powered by Cobalt