1. Felipe Vega
  2. Newbie area
  3. Saturday, 01 March 2014
  4.  Subscribe via email
Mandatory information about my setup:

Have I searched the tickets before posting? yes
Have I searched the forum before posting? esy
Have I read the documentation before posting (which pages?)? yes
PHP version: 5.3
MySQL version: (unknown)
Hotspots version: 3.5
Direct link to the page that shows the issue: (unknown)
https://tampicovirtual.com.mx/index.php/zona1/directorio-movil#!/catid=1

Description of my issue:
need to activate geolocalization script on hotspots but i dont know were to insert the code also how much of the code will i need..i let you that code that i have found.

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>;

<script type="text/javascript" src="/jquery.cookie.js"></script>
<script type="text/javascript">
function success(position)
{
var s = document.querySelector('#status');
if (s.className == 'success')
{
return;
}
s.innerHTML = "Found you!";
s.className = 'Success';
var mapcanvas = document.createElement('div');
mapcanvas.id = 'mapcanvas';
mapcanvas.style.height = '100%';
mapcanvas.style.width = '100%';
document.querySelector('#map').appendChild(mapcanvas);
var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
var myOptions = {
zoom: 15,
center: latlng,
mapTypeControl: false,
navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("mapcanvas";), myOptions);
var marker = new google.maps.Marker({
position: latlng,
map: map,
title:"You are here!"
});
$.cookie("MyLat", position.coords.latitude); // Storing latitude value
$.cookie("MyLon", position.coords.longitude); // Storing longitude value
}
function error(msg)
{
var s = document.querySelector('#status');
s.innerHTML = typeof msg == 'string' ? msg : "failed";
s.className = 'Fail';
}
if (navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(success, error);
}
else
{
error('Not supported'); //HTML Support
}

//Jquery Code
$(document).ready(function()
{
$("#check";).click(function()
{
var lat = $.cookie("MyLat";);
var lon = $.cookie("MyLon";);
alert('Latitued: '+lat);
alert('Longitude: '+lon);
var url="http://maps.googleapis.com/maps/api/geocode/json?latlng="+lat+";,"+lon+"&sensor=false";
alert('Google Map API: '+url);
//Get Json Request Here
});
});
</script>
//HTML Code
<input type='button' id='check' value='Check-out'/>
<div id="status">Loading.............</div>
<div id="map"></div>
Responses (6)


There are %s replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now

Last questions

Veranstaltung im Frontend sichtbar obwohl nicht ve
Hallo, folgendes Problem stellt sich mir: Wenn ich eine Veranstaltung dupl...
4 Replies
Posted on Friday, 09 February 2024
Suche bei der Matukio - Fehler Ö Ä Ü..
Hallo, evtl. könnt ihr mir weiterhelfen. Bei mir funktioniert die suche bei ...
3 Replies
Posted on Wednesday, 15 May 2024
  • New
  • When is CComment compatible with Joomla 5?
    When is CComment compatible with Joomla 5?...
    4 Replies
    Posted on Tuesday, 05 December 2023
    • #CComment
    • #Joomla 5
    _MATUKIO_NO_EVENTS appears in the frontend if no e
    Hello, there ist still the problem, that on the frontpage appears COM_MATUKIO...
    2 Replies
    Posted on Sunday, 12 May 2024
  • New
  • verschiedene URL's für Kursübersicht einer Kategor
    Hallo, ich habe eine Frage in Bezug auf SEO: ein externer Spezialist macht die...
    3 Replies
    Posted on Monday, 29 April 2024