Jump to content

Page magasins : augmenter le zoom et supprimer la partie trouver un mag proche


Recommended Posts

D'abord merci à Christophe qui a trouvé les solutions pour :

 

 

- quand dans votre espaces "magasins" vous avez rempli les coordonnées GPS et que vous trouvez que le zoom google ne cible pas assez de près votre magasin, vous pouvez augmenter le zoom par défaut de la façon suivante :

 

Dans le fichier :

 

<script type="text/javascript" src="www.monsite.com/themes/NomdeMonTheme/js/stores.js"></script>

 

trouvez as la ligne (ligne 126 dans mon cas) :

 

if (map.getZoom() > 13) map.setZoom(13);

 

il suffit de remplacer 13 par un autre chiffre (moi j'ai mis 20).

 

Puis plus bas (ligne 196) augmenter le zoom:10 par une autre valeur (par exemple 18)

 

$(document).ready(function()

{

map = new google.maps.Map(document.getElementById('map'), {

center: new google.maps.LatLng(defaultLat, defaultLong),

zoom: 10,

mapTypeId: 'roadmap',

mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}

});

 

 

 

 

Si vous trouvez que tout le truc suivant ne sert à rien :

 

Entrez un emplacement (par exemple: un code postal, une adresse, une ville ou un pays) afin de trouver des magasins les plus proches.

Votre position:

Radius: km"

 

 

Vous pouvez le supprimer, ou plus exactement le masquer (car la suppression entraîne un bug)

 

pour cela, dans votre thème, choisir le fichier store.tpl

 

Puis our "masquer" les lignes, tu peux utiliser ça :

 

<div class="hidden">

 

Code html à cacher

 

</div>

 

 

Concrètement voici la source au départ :

 

 

<script type="text/javascript">

// <![CDATA[

var map;

var markers = [];

var infoWindow;

var locationSelect;

 

var defaultLat = '{$defaultLat}';

var defaultLong = '{$defaultLong}';

 

var translation_1 = '{l s='No store found, try to select a wider radius' js=1}';

var translation_2 = '{l s='store found - see details:' js=1}';

var translation_3 = '{l s='stores found - see all results:' js=1}';

var translation_4 = '{l s='Phone:' js=1}';

var translation_5 = '{l s='Get Directions' js=1}';

var translation_6 = '{l s='Not found' js=1}';

 

var hasStoreIcon = '{$hasStoreIcon}';

var distance_unit = '{$distance_unit}';

var img_store_dir = '{$img_store_dir}';

var img_ps_dir = '{$img_ps_dir}';

//]]>

</script>

 

 

<p>{l s='Enter a location (eg.: a zip/postal code, an address, a city or a country) in order to find the nearest stores.'}</p>

<p>{l s='Your location:'} <input type="text" name="location" id="addressInput" value="{l s='Address, zip/postal code, city, state or country'}" onclick="this.value='';" /></p>

<p style="margin-top: 15px;">

{l s='Radius:'}

<select name="radius" id="radiusSelect">

<option value="15">15</option>

<option value="25">25</option>

<option value="50">50</option>

<option value="100">100</option>

</select> {$distance_unit}

<input type="button" class="button" onclick="searchLocations();" value="{l s='Search'}" style="display: inline;" />

<img src="{$img_ps_dir}loader.gif" class="middle" alt="" id="stores_loader" />

</p>

 

 

 

 

<div><select id="locationSelect"></select></div>

<div id="map"></div>

<table cellpadding="0" cellspacing="0" id="stores-table">

<tr>

<th>{l s='#'}</th>

<th>{l s='Store'}</th>

<th>{l s='Address'}</th>

<th>{l s='Distance'}</th>

</tr>

</table>

 

 

 

ET VOICI LA SOURCE CORRIGÉE

 

<script type="text/javascript">

// <![CDATA[

var map;

var markers = [];

var infoWindow;

var locationSelect;

 

var defaultLat = '{$defaultLat}';

var defaultLong = '{$defaultLong}';

 

var translation_1 = '{l s='No store found, try to select a wider radius' js=1}';

var translation_2 = '{l s='store found - see details:' js=1}';

var translation_3 = '{l s='stores found - see all results:' js=1}';

var translation_4 = '{l s='Phone:' js=1}';

var translation_5 = '{l s='Get Directions' js=1}';

var translation_6 = '{l s='Not found' js=1}';

 

var hasStoreIcon = '{$hasStoreIcon}';

var distance_unit = '{$distance_unit}';

var img_store_dir = '{$img_store_dir}';

var img_ps_dir = '{$img_ps_dir}';

//]]>

</script>

 

<div class="hidden">

 

<p>{l s='Enter a location (eg.: a zip/postal code, an address, a city or a country) in order to find the nearest stores.'}</p>

<p>{l s='Your location:'} <input type="text" name="location" id="addressInput" value="{l s='Address, zip/postal code, city, state or country'}" onclick="this.value='';" /></p>

<p style="margin-top: 15px;">

{l s='Radius:'}

<select name="radius" id="radiusSelect">

<option value="15">15</option>

<option value="25">25</option>

<option value="50">50</option>

<option value="100">100</option>

</select> {$distance_unit}

<input type="button" class="button" onclick="searchLocations();" value="{l s='Search'}" style="display: inline;" />

 

</div>

 

<img src="{$img_ps_dir}loader.gif" class="middle" alt="" id="stores_loader" />

</p>

 

 

 

 

 

<div><select id="locationSelect"></select></div>

<div id="map"></div>

<table cellpadding="0" cellspacing="0" id="stores-table">

<tr>

<th>{l s='#'}</th>

<th>{l s='Store'}</th>

<th>{l s='Address'}</th>

<th>{l s='Distance'}</th>

</tr>

</table>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...