Jump to content

Customizacion De Store.tpl Mapa No Me Muestra El Marker Personalizado


MikePn

Recommended Posts

Estimados, 

 

Tengo seleccionado el localizador simplificada y al archivo store.tpl le hice algunas modificaciones, por ejemplo le agregue el codigo del mapa de google para que me lo muestre, el problema que no logro resolver desde ayer es que no me aparece el marker personalizado, ni siquiera me aparece el marker por default de google. 

 

Les copio el codigo a continuación y si alguien puede ayudarme estare muy agradecido.

 

Además, la consola de chrome de da el siguiente error: Uncaught ReferenceError: myLatLng is not defined

 

Saludos

{capture name=path}{l s='Our stores'}{/capture}
<script src="https://maps.googleapis.com/maps/api/js"></script>
    <script>
      function initialize() {
        var mapCanvas = document.getElementById('map');
        var mapOptions = {
          center: new google.maps.LatLng(-34.5805911, -58.4133211),
          zoom: 17,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        }
        var map = new google.maps.Map(mapCanvas, mapOptions)
      }
      google.maps.event.addDomListener(window, 'load', initialize);
	var iconBase = 'https://maps.google.com/mapfiles/kml/shapes/';
	var marker = new google.maps.Marker({
	  position: myLatLng,
	  map: map,
	});

    </script>
<h1 class="page-heading">
	{l s='Our stores'}
</h1>

{if $simplifiedStoresDiplay}
	{if $stores|@count}
		<p class="store-title">
			<strong class="dark">
				<!--{l s='Here you can find our store locations. Please feel free to contact us:'} -->
			</strong>
		</p>
		<div class="row">
		<div class="col-l-4 col-sm-4">
			{foreach $stores as $store}
			{if $store.has_picture}
				<div class="store-image">
					<img src="{$img_store_dir}{$store.id_store}.jpg" alt="" />
				</div>
			{/if}
		</div>
		<div class="col-l-4 col-sm-4">
			{assign value=$store.id_store var="id_store"}
            {foreach from=$addresses_formated.$id_store.ordered name=adr_loop item=pattern}
                {assign var=addressKey value=" "|explode:$pattern}
                {foreach from=$addressKey item=key name="word_loop"}
                    <span {if isset($addresses_style[$key])} class="{$addresses_style[$key]}"{/if}>
                        {$addresses_formated.$id_store.formated[$key|replace:',':'']|escape:'html':'UTF-8'}
                    </span>
                {/foreach}
        	{/foreach}
			<br/>
			{if $store.phone}<br/>{l s='Phone:'} {$store.phone|escape:'html':'UTF-8'}{/if}
			{if $store.fax}<br/>{l s='Fax:'} {$store.fax|escape:'html':'UTF-8'}{/if}
			{if $store.email}<br/>{l s='Email:'} {$store.email|escape:'html':'UTF-8'}{/if}
			{if $store.note}<br/><br/>{$store.note|escape:'html':'UTF-8'|nl2br}{/if}
		</div>
		<div class="col-l-4 col-sm-4">
			{if isset($store.working_hours)}{$store.working_hours}{/if}
		</div>
		</div>
		<div class="row">
		<div id="map"></div>
	    </div>
			{/foreach}
	   
	{/if}
{else}
	<div id="map"></div>
	<p class="store-title">
		<strong class="dark">
			{l s='Enter a location (e.g. zip/postal code, address, city or country) in order to find the nearest stores.'}
		</strong>
	</p>
    <div class="store-content">
        <div class="address-input">
            <label for="addressInput">{l s='Your location:'}</label>
            <input class="form-control grey" type="text" name="location" id="addressInput" value="{l s='Address, zip / postal code, city, state or country'}" />
        </div>
        <div class="radius-input">
            <label for="radiusSelect">{l s='Radius:'}</label> 
            <select name="radius" id="radiusSelect" class="form-control">
                <option value="15">15</option>
                <option value="25">25</option>
                <option value="50">50</option>
                <option value="100">100</option>
            </select>
            <img src="{$img_ps_dir}loader.gif" class="middle" alt="" id="stores_loader" />
        </div>
        <div>
            <button name="search_locations" class="btn btn-default btn-sm icon-right">
            	<span>
            		{l s='Search'}
            	</span>
            </button>
        </div>
    </div>
    <div class="store-content-select selector3">
    	<select id="locationSelect" class="form-control">
    		<option>-</option>
    	</select>
    </div>

	<table id="stores-table" class="table table-bordered">
    	<thead>
			<tr>
                <th class="num">#</th>
                <th>{l s='Store'}</th>
                <th>{l s='Address'}</th>
                <th>{l s='Distance'}</th>
            </tr>		
        </thead>
        <tbody>
        </tbody>
	</table>
   
    {strip}
        {addJsDef map=''}
        {addJsDef markers=array()}
        {addJsDef infoWindow=''}
        {addJsDef locationSelect=''}
        {addJsDef defaultLat=$defaultLat}
        {addJsDef defaultLong=$defaultLong}
        {addJsDef hasStoreIcon=$hasStoreIcon}
        {addJsDef distance_unit=$distance_unit}
        {addJsDef img_store_dir=$img_store_dir}
        {addJsDef img_ps_dir=$img_ps_dir}
        {addJsDef searchUrl=$searchUrl}
        {addJsDef logo_store=$logo_store}
        {addJsDefL name=translation_1}{l s='No stores were found. Please try selecting a wider radius.' js=1}{/addJsDefL}
        {addJsDefL name=translation_2}{l s='store found -- see details:' js=1}{/addJsDefL}
        {addJsDefL name=translation_3}{l s='stores found -- view all results:' js=1}{/addJsDefL}
        {addJsDefL name=translation_4}{l s='Phone:' js=1}{/addJsDefL}
        {addJsDefL name=translation_5}{l s='Get directions' js=1}{/addJsDefL}
        {addJsDefL name=translation_6}{l s='Not found' js=1}{/addJsDefL}
    {/strip}
{/if}

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...