If you can run this one by sync,
http://www.ownedcore.com/forums/poke...kemon-map.html (Even more precise location of nearby pokemon ON MAP!)
you can most likely run this one. However there is more work involved to set it up
CHECK SERVER STATUS BEFORE POSTING ERRORS
https://go.jooas.com/
Method 1
1) download
https://github.com/memelyfe/pokemong...chive/maps.zip
2)Extract to C:\
so you have C:\\pokemongo-api-demo-maps
3) rename run.sh to run.bat and right click edit
4) paste in the following, assuming chrome is in the default location.
PTC login only.
Code:
"C:\Program Files (x86)\Google\Chrome\Application\Chrome.exe" 127.0.0.1:8000\index.html --args --disable-web-security --allow-file-access-from-files
python main.py -u username -p passowrd -l "location"
5) open config.json and take the api key below or register for an api key here
https://console.developers.google.com/apis/credentials
Code:
{ "GOOGLE_MAPS_API_KEY": "AIzaSyAZzeHhs-8JZ7i18MjFuM35dJHq70n3Hx4"
}
6a) If python is in path
open a command prompt and type the following
Code:
python -m SimpleHTTPServer 8000
6b) open a command prompt and point to python install; if python installed in C:\python27 if somewhere else change it accordingly
Code:
"C:\Python27\python.exe" -m SimpleHTTPServer 8000
7) double click run.bat
Method 2
If your having issues.
Over night the link was still old data. the thread didn't update the link target just the text. perks of being tired.
(No longer contains my extra marker data)
https://www.wetransfer.com/downloads...7110412/ec402b
- Extract to C:\\
- Open pokemongo-api-demo
- edit run2.bat and change username, password and location. Save changes.
- Double click run.bat
- Double click run2.bat
Common errors:
- 4 pokemon in columbus
- i uploaded with info in data.json. data.json should be empty besides some [ ]
- Not seeing pokemon or map
- Do you have two open cmd windows?
- One with the httpserver running
- second with the main script running
- should show the standard login and pokemon within x steps read out.
- [+] Received API endpoint: https:///rpc
- [-] API request error, retrying
- Either PTC or PoGo servers are down
If your using my files you can update the index.html to add a hide option.
Code:
<!DOCTYPE html>
<html>
<head>
<title>Drawing tools</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
#legend {
background: #FFF;
padding: 10px;
margin: 5px;
font-size: 12px;
font-family: Arial, sans-serif;
height: 255px;
width: 150px;
}
#legend div {
height: 210px;
overflow: auto;
}
#legend li {
list-style-type: none;
}
</style>
</head>
<body>
<div id="map"></div>
<div id="capture"></div>
<script>
function loadScript(src) {
var element = document.createElement("script");
element.src = src;
document.body.appendChild(element);
}
function getFile(path, asynch, callback) {
var xhr = new XMLHttpRequest();
xhr.open("GET", path, asynch);
xhr.onload = function (e) {
if (xhr.readyState === 4) {
callback(xhr.responseText);
}
};
xhr.onerror = function (e) {
console.error(xhr.status);
};
xhr.send(null);
}
function cap(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function pad(n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
function toggleLayer(checked, pkmn) {
if (checked) {
hidden_layers.push(pkmn);
} else {
var index = hidden_layers.indexOf(pkmn);
if(index > -1){
hidden_layers.splice(index,1);
}
}
refreshData();
};
function refreshData() {
getFile("data.json", true, function(response) {
console.log("Refreshing data...");
var preLength = data.length;
data = JSON.parse(response);
if (preLength != data.length) {
// Clear markers
for (var i = 0; i < markers.length; i++) {
listeners[i].a.remove();
listeners[i].b.remove();
markers[i].setMap(null);
}
listeners = [];
markers = [];
// Add updated markers
for (var i = 0; i < data.length; i++) {
var p = data[i];
if (!updated) {
map.setZoom(16);
map.panTo({lat: p.lat, lng: p.lng});
updated = true;
}
if(hidden_layers.indexOf(p.name) == -1){
// Pokemon not hidden
if(layers.indexOf(p.name) == -1){
layers.push(p.name);
}
console.log("Adding marker " + p.name);
var infowindow = new google.maps.InfoWindow({
});
var image = "http://icons.iconarchive.com/icons/hektakun/pokemon/72/" + pad(p.id, 3) + "-" + cap(p.name) + "-icon.png";
var marker = new google.maps.Marker({
map: map,
position: {lat: p.lat, lng: p.lng},
//label: p.name.charAt(0),
title: "<b>"+p.name+"</b><br>Time left: " + p.poketime + "<br>Lat: "+p.lat+"<br>Long: "+p.lng,
icon: image
});
var listenerPair = {
a: google.maps.event.addListener(marker, 'mouseover', function() {
infowindow.setContent(this.title);
infowindow.open(map, this);
}),
b: google.maps.event.addListener(marker, 'mouseout', function() {
infowindow.close(map, this);
})
};
listeners.push(listenerPair);
markers.push(marker);
}
}
// Draw layer manager
var list = document.getElementById('legend-list');
var content = [];
for (var id in layers) {
var pkmn = layers[id];
var checked = hidden_layers.indexOf(pkmn) != -1 ? "checked": "";
content.push("<li><input type='checkbox' id='" + pkmn + "'" +
" onclick='toggleLayer(this.checked, this.id)' "+checked+"\/>" +
pkmn + "<\/li>");
}
list.innerHTML = content.join('');
}
});
}
data = {};
map = null;
markers = [];
listeners = [];
hidden_layers = [];
layers = [];
updated = false;
getFile("config.json", false, function(configData) {
config = JSON.parse(configData)
console.log("Using api key: " + config.GOOGLE_MAPS_API_KEY);
loadScript("https://maps.googleapis.com/maps/api/js?key=" + config.GOOGLE_MAPS_API_KEY + "&libraries=drawing&callback=initMap");
});
function initMap() {
console.log("Initializing map");
setInterval(refreshData, 1000);
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 0, lng: 0},
zoom: 4
});
var legend = document.createElement('div');
legend.id = 'legend';
var content = [];
content.push('<h3>Hide Pokemon</h3>');
content.push('<div id="legend-list"></div>');
legend.innerHTML = content.join('');
legend.index = 1;
map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(legend);
}
</script>
</body>
</html>