Skip to content

Instantly share code, notes, and snippets.

@beautyfree
Created March 1, 2012 19:38
Show Gist options
  • Save beautyfree/1952527 to your computer and use it in GitHub Desktop.
Save beautyfree/1952527 to your computer and use it in GitHub Desktop.
{if $oLocation and $oLocation->getLatLng() != 0}
<script type="text/javascript" src="http://code.google.com/apis/gears/gears_init.js" charset="utf-8"></script>
{if Config::Get('plugin.location.yandex.use')}
<script type="text/javascript" src="http://api-maps.yandex.ru/1.1/index.xml?key={$oConfig->GetValue('plugin.location.yandex.key')}&modules=regions~pmap"></script>
<script type="text/javascript">
devall.location.options.provider = 'yandex';
{if Config::Get('plugin.location.yandex.type') == 'nmap'}
devall.location.options.yandex_type = '{Config::Get('plugin.location.yandex.type')}';
{/if}
</script>
{else}
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=geometry&sensor=false"></script>
{/if}
<script type="text/javascript">
devall.location.options.zoom = {Config::Get('plugin.location.map.zoom')};
devall.location.options.lang.title = '{$oLocation->getTitle()}';
devall.location.options.lang.description = '{$oLocation->getText()}';
$(document).ready(function(){
devall.location.position = [{$oLocation->getLatLng()}];
{if !Config::Get('plugin.location.hide.map.add')}
devall.location.initMap();
devall.location.addMarker();
{/if}
});
</script>
<div class="location" style="{if Config::Get('plugin.location.hide.map.topic')}display:none;{/if} height:{Config::Get('plugin.location.map.height')}">
<div id="map_canvas"></div>
</div>
{/if}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment