Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::IP File2MAP
- ::By SachaDee © 2015
- @echo off
- call:make
- setlocal enabledelayedexpansion
- set "$var=1"
- set "$Liste="
- set "$StaticUrl=https://maps.googleapis.com/maps/api/staticmap?center=0,0&zoom=1&size=500x300&maptype=satellite"
- (
- echo ^<!DOCTYPE html^>
- echo ^<html^>
- echo ^<head^>
- echo ^<meta name="viewport" content="initial-scale=1.0, user-scalable=no"^>
- echo ^<meta charset="utf-8"^>
- echo ^<title^>Votre Localisation^</title^>
- echo ^<style^>
- echo html, body, #map-canvas {
- echo height: 100%%;
- echo margin: 0px;
- echo padding: 0px
- echo }
- echo ^</style^>
- echo ^<script src="https://maps.googleapis.com/maps/api/js?v=3.exp^&signed_in=true"^>^</script^>
- echo ^<script^>
- echo function initialize(^) {
- echo var myLatlng = new google.maps.LatLng(0,0^);
- )>carte.html
- for /f "tokens=1,2 delims==" %%x in (Ip_liste.txt) do (
- set "$Nom=%%x"
- set "$Ip=%%y"
- for /f "tokens=6,7 delims=," %%a in ('cscript.exe getcount.vbs http://ip-api.com/json/!$Ip!') do (
- for /f "tokens=2 delims=:" %%i in ('echo %%a') do set $lat=%%i
- for /f "tokens=2 delims=:" %%i in ('echo %%b') do set $lon=%%i
- echo Traitement IP -^> [!$IP!]
- echo Lattitude -^> [!$Lat!]
- echo Longitude -^> [!$Lon!]
- echo ---
- echo var myLatlng!$var! = new google.maps.LatLng(!$Lat!,!$Lon!^);>>carte.html
- set $StaticUrl=!$StaticUrl!^&markers=color:blue%%7Clabel:S%%7C!$Lat!,!$Lon!
- set /a $var+=1
- set $Liste=!$Liste! !$nom!
- )
- )
- (echo var mapOptions = {
- echo zoom: 2,
- echo center: myLatlng
- echo }
- echo var map = new google.maps.Map(document.getElementById('map-canvas'^), mapOptions^);
- )>>carte.html
- set /a $var-=1
- for /l %%a in (1,1,!$var!) do (
- set $c=1
- for %%x in (!$liste!) do (
- if "!$c!"=="%%a" (
- (echo var marker = new google.maps.Marker({
- echo position: myLatlng%%a,
- echo map: map,
- echo title: '%%x'
- echo }^);)>>carte.html
- )
- set /a $c+=1
- )
- )
- (echo }
- echo google.maps.event.addDomListener(window, 'load', initialize^);
- echo ^</script^>
- echo ^</head^>
- echo ^<body^>
- echo ^<div id="map-canvas"^>^</div^>
- echo ^</body^>
- echo ^</html^>
- )>>carte.html
- start carte.html
- start !$StaticUrl!
- del GetCount.vbs 2>nul
- exit/b
- :make
- If not exist Getcount.vbs ((
- echo Dim o
- echo Var1=Wscript.Arguments(0^)
- echo Set o = CreateObject("MSXML2.XMLHTTP"^)
- echo o.open "GET", var1, False
- echo o.send
- echo wscript.echo o.responseText
- )>GetCount.vbs
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement