Car-PC.info

Talk talk talk - Hilfe für Gpsgateserver gebraucht

haifisch - Sa 18 Aug, 2012 22:28
Titel: Hilfe für Gpsgateserver gebraucht
Servus,
ich brauche Hilfe, wie ich die Karte mit der Position auf eine Webseite von meinem Server zum Laufen bekomme.

Auf folgender Seite ist die Anleitung, welche ich seitens mysql abgearbeitet habe. Auch bis zum get code Button ist alles erledigt. Nun kommen die Scriptabschnite und darüber, was ich tun soll. Nur nicht wo.
http://forum.gpsgate.com/topic.asp?TOPIC_ID=6800

Als erstes kommt:

Content
Paste between <HEAD> </HEAD>
(Ist nur ein kleiner Ausschnitt vom ganzen Code)

Code:

<script></script>
<script></script>

<script>

   // Group to receive data from
   var groupName = 'Ortung';
   var lastUpdated = new Date();

   
            markerDictionary[username] = marker;
            map.addOverlay(marker);
         }

         marker.gpsGateUser = user; // make user accessible for the infowindow click-event

         marker.setLatLng(point); // update position
      }
   }
</script>


Da muß ich davor und danach Head einsetzen, oder?


Als nächstes kommt

Paste into the <BODY> tag ex. <body>

Code:

onload="load()"


Da habe ich schon keine Ahnung, was ich tun soll.


Dann kommt noch:

Paste between <BODY> </BODY>

Code:

<div></div>
<a href="http://gpsgate.com/" id="gpsgate" alt="gpsgate tracking" target="_blank">
  <img src="http://apps.gpsgate.com/images/ggc_small.gif">
  <span>
    GPS Tracking
  </span>
</a>


Das verstehe ich auch nicht.
Das ganze soll wohl in eine Webseite verwandelt werden. Das erste Script habe ich schon mal in eine *.htm Datei integriert. Da kommt eine leere Webseite raus beim Aufruf. Was muß ich mit den anderen Scripten tun?

Kann mir da bitte jemand helfen?
Danke im Voraus
datenflo - So 19 Aug, 2012 13:20
Titel:
zeig mal bitte den gesamten code vom ersten Teil
haifisch - So 19 Aug, 2012 16:49
Titel:
Das habe ich gegen die Haupturl meines Servers getauscht
"http://apps.gpsgate.com/Services/GpsTracking.ashx?xssproxy&appId=12&namespace=MyService
Wenn ich den Api key verändere kommt die Meldung falscher api. Der Teil funktioniert.

Irgendwie wird der Teil nach <script></script> verschluckt. Darum unten der erste Teil nochmal als Bild.



[
PHP:
<?php <HEAD
<
script></script>
<script></script>

<script>

    // Group to receive data from
    var groupName = 'Ortung';
    var lastUpdated = new Date();

    // Get only users online since last week
    var lastOnlineThreadsHoldMinutes = 10080;

    // Check for position updates each 10sek
    var updateIntervalMS = 10000;

    var userDictionary = {};
    var markerDictionary = {};

    var map = null;

    function load()
    {
        map = new GMap2(document.getElementById(&quot;map&quot;));

        // Add zoom/pan & type controls
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(49.99999999999999, 10.000000000000004), 1);
        map.setMapType(G_NORMAL_MAP);

        // init the last update time stamp
        lastUpdated = new Date(lastUpdated.getTime() - lastOnlineThreadsHoldMinutes * 60000);

        // start polling for positions
        getUsers();
    }

    function getUsers()
    {
        GpsGate.Server.MyService.getUpdatedUsersInGroup(groupName, lastUpdated,
            function(result)
            {
                // Set last update to the time when the query was executed on the server
                // this will make next call to only get users with new positions since this call
                lastUpdated = new Date(result.queryTimeStamp.getTime() - 5 * 60000);

                // Iterate through the result of gateUsers
                for (var i = 0; i <result> 0)
                {
                    // Repaint the map with new positions
                    repaintMap();
                }

                // make a new call to the server in 10sek
                setTimeout(getUsers, updateIntervalMS);
            }
        );
    }

    function repaintMap()
    {
        for (var username in userDictionary)
        {
            // Get the user from dictionary
            var user = userDictionary[username];

            // Get the latest position from the user
            var lat = user.trackPoint.position.latitude;
            var lng = user.trackPoint.position.longitude;
            var point = new GLatLng(lat, lng);

            var marker = markerDictionary[username];

            if (marker == null)
            {
                marker = new GMarker(point);

                // Add InfoWindow when clicking on marker
                GEvent.addListener(marker, &quot;click&quot;,
                    function()
                    {
                        var user = this.gpsGateUser;

                        var htmlString = &quot;<div><strong>Username:&nbsp;</strong>&quot;
                           + user.username
                           + &quot;<br>&quot;
                           + &quot;<strong>Last updated pos:</strong>&quot;
                           + &quot;<br>&quot;
                           + user.trackPoint.utc.toLocaleDateString()
                           + &quot;<br>&quot;
                           + user.trackPoint.utc.toLocaleTimeString();
                           + &quot;</div>&quot;;

                        this.openInfoWindowHtml(htmlString);
                    }
                );

                markerDictionary[username] = marker;
                map.addOverlay(marker);
            }

            marker.gpsGateUser = user; // make user accessible for the infowindow click-event

            marker.setLatLng(point); // update position
        }
    }
</script>

</HEAD> ?>





Image
datenflo - Mo 20 Aug, 2012 18:03
Titel:
speicher die dat mal als .php und nicht html
haifisch - Mo 20 Aug, 2012 19:38
Titel:
Hat leider nicht funktioniert. Selbes Ergebnis - eine leere Seite.
AndreR250282 - Di 21 Aug, 2012 15:19
Titel:
Ich hab dir die Datei nach den Vorgaben mal erstellt, 2 Anmerkungen:

a) scheint der google API key des ersten <script tags nicht korrekt zu sein
b) musst du im 2ten <script tag das mein.dyndns.org noch gegen die korrekte URL austauschen
haifisch - Mi 22 Aug, 2012 16:00
Titel:
Danke nochmal für die Hilfe. Leider hat es nicht funktioniert. Die Google Fehlermeldung war klar. Wegen Unwissenheit, ob jemand fremdes mit dem Code was anfangen kann, habe ich den gekürzt gepostet und auch die Server Url. Es kommt trotz der korrekten Eingaben danach keine Karte. Ich habe da jetzt in dem gpsgate Forum einen Beitrag gefunden, so wie ich das mit meinen Schulnote 5- Englischkentnissen verstehen hat da jemand ein ähnliches Problem gehabt. Ich werde das mal durcharbeiten.

http://forum.gpsgate.com/topic.asp?TOPIC_ID=9475
Alle Zeiten sind GMT + 1 Stunde
Powered by phpBB2 Plus and Kostenloses Forum based on phpBB