<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.fr.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>22 Dec 2018 09:43:56 Z</lastBuildDate><pubDate>17 Dec 2018 10:51:34 Z</pubDate><description>Bonjour,&#13;
&#13;
Je travail sur le développement d'un logiciel sur WINDEV dans lequel un utilisateur saisi deux adresses, puis le programme calcul la distance en km séparant ces deux points. Avant le logiciel utilisait l'API de google map cependant celle-ci est devenue payante, c'est pourquoi je cherche une alternative gratuite à google map. &#13;
Après avoir saisi les adresse, l'utilisateur doit pouvoir connaitre la distance (routière et pas à vol d'oiseau) entre un point A et un point B. Et dans un second temps, afficher le trajet sur une carte pour que l'utilisateur sache sur quel trajet le programme à calculé la distance.&#13;
Ma première solution était de récupérer les deux adresses et de les placer dans une URL de google map : &#13;
&#13;
[code:wl]&#13;
sHTML  est une chaîne = ChaîneConstruit("https://www.google.fr/maps/dir/""%1""/""%2""", ... &#13;
Remplace(FEN_Menu.SAI_Départ," ","+") + ",+" + FEN_Menu.SAI_VilleDépart,Remplace(FEN_Menu.SAI_Arrivé," ","+") + ",+" + FEN_Menu.SAI_VilleArrivé)&#13;
sTmp est une chaîne = Remplace(Remplace(sHTML, """",""),"""","")&#13;
[/code]&#13;
&#13;
Ainsi je peux déjà : &#13;
1) Ouvrir la page dans un navigateur&#13;
2) Ouvrir la page dans un champs HTML&#13;
&#13;
J'ai donc ouvert la page dans un champ HTML et avec ..ValeurAffichée je peux récupérer le code HTML. Après rien de plus simple que de le placer dans une chaine est d'aller chercher le kilometrage dans le code HTML. Malheureusement quand je met le code dans une chaine celui-ci est tronqué car il est beaucoup trop long pour être placé dans une chaine (~ 500 000 caractères) la chaine ne contient donc que 8133 caractère ;( .&#13;
&#13;
Je n'ai donc pas cherché plus loin avec cette solution... &#13;
&#13;
Je me suis interréssé à Open Street Map qui est libre et utilisé dans de nombreuses librairie, j'ai commencé à découvrir Leaflet qui est une librairie JavaScript.&#13;
Je crée un champ .NET (WebBrowser) dans lequel j'intègre un code HTML contenant une carte et deux point. &#13;
La carte s'affiche :D ! &#13;
Seulement il y a quelques problèmes :&#13;
	--&gt; Deux points s'affiche mais je n'arrive pas à afficher l'itinéraire entre ces deux points, il y a des erreur dans mon code mais je ne sais pas vraiment où...&#13;
	Une erreur s'affiche :&#13;
	Ligne : 28&#13;
	Carctère : 1&#13;
	Erreur : Impossible d'obtenir la propriète &lt;&lt;Control&gt;&gt; d'une référence null ou non définie&#13;
&#13;
	--&gt; Ce sont des coordonnées GPS (Latitude, Longitude) qui doivent être utilisée par Leaflet... Il faut donc que je trouve une solution pour convertir des adresses en coordonées GPS.&#13;
&#13;
Ci-dessous voici le code que je met dans mon .NET : &#13;
&#13;
[code:xml]&#13;
&lt;html&gt;&#13;
	&lt;link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css"&#13;
		integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA=="&#13;
		crossorigin=""/&gt;&#13;
	&lt;script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js"&#13;
		integrity="sha512-nMMmRyTVoLYqjP9hrbed9S+FzjZHW5gY1TWCHA5ckwXZBadntCNs8kEqAWdrb9O7rxbCaA4lKTIWjDXZxflOcA=="&#13;
		crossorigin=""&gt;&lt;/script&gt;&#13;
	&lt;/head&gt;&#13;
	&lt;body&gt;		&#13;
		&lt;div id="mapid" style="width: 640px; height: 480px;"&gt;&lt;/div&gt;&#13;
		&lt;script&gt;	&#13;
			var mymap = L.map('mapid').setView([1.369115, 103.845436], 12);&#13;
			L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {attribution: 'Map data © &lt;a href="https://www.openstreetmap.org/"&gt;OpenStreetMap&lt;/a&gt; contributors, &lt;a href="https://creativecommons.org/licenses/by-sa/2.0/"&gt;CC-BY-SA&lt;/a&gt;, Imagery © &lt;a href="https://www.mapbox.com/"&gt;Mapbox&lt;/a&gt;',&#13;
			maxZoom: 18,&#13;
			id: 'mapbox.streets',&#13;
			accessToken: 'pk.eyJ1IjoiaG91cmNoYW5pIiwiYSI6ImNqbXhyczE1MDB4bTUza3BoZXZkMnI0emsifQ.AniQEtfLHqxrk1gfZTMrJA'&#13;
			}).addTo(mymap);&#13;
			&#13;
			var start = L.marker([1.29828408457,103.789110693]);&#13;
			var end = L.marker([1.41887924373,103.847815159]);&#13;
			&#13;
			start.addTo(mymap).bindPopup("Start from Office");&#13;
			end.addTo(mymap).bindPopup("End in MyHome");&#13;
			&#13;
			var routingControl = new L.Routing.Control({&#13;
				waypoints: [start,end],&#13;
				show: true&#13;
			}).router().addTo(map);&#13;
		&lt;/script&gt;&#13;
	&lt;/body&gt;&#13;
&lt;/html&gt;&#13;
[/code]&#13;
&#13;
Ce que j'aimerai en priorité c'est récupérer la distance entre 2 points donc, il n'y a pas vraiment besoin d'afficher une carte pour ça… Cependant c'est mieux pour l'utilisateur de voir par où le logiciel le fait passer pour une distance donnée.&#13;
J'espère avoir bien exposé ce que je cherche à faire, ci quelqu'un trouve une bonne solution il recevra ma reconnaissance éternelle.</description><ttl>30</ttl><generator>WEBDEV</generator><language>fr_FR</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev/read.awp</link><title>Recherche d'alternative à google map WINDEV</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>MANUEL</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222890/read.awp</comments><pubDate>22 Dec 2018 09:43:56 Z</pubDate><description>Bonjour, bravo pour ce code, j'ai justement écrit hier à PCSOFT pour essayer d'avoir dans une prochaine  LST ce genre de code sa…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222890/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222890/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev/read.awp">Recherche d'alternative à google map WINDEV</source><title>Re: Recherche d'alternative à google map WINDEV</title></item><item><author>l.bories</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222886/read.awp</comments><pubDate>21 Dec 2018 16:37:56 Z</pubDate><description>Joyeux noël :merci:</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222886/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222886/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev/read.awp">Recherche d'alternative à google map WINDEV</source><title>Re: Recherche d'alternative à google map WINDEV</title></item><item><author>l.bories</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222885/read.awp</comments><pubDate>21 Dec 2018 16:36:53 Z</pubDate><description>Merci d'avoir pris le temps de me répondre, j'ai pour consigne de base de ne pas utiliser google map. &#13;
&#13;
Pour mon problème j'ai…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222885/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222885/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev/read.awp">Recherche d'alternative à google map WINDEV</source><title>Re: Recherche d'alternative à google map WINDEV</title></item><item><author>l.bories</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222884/read.awp</comments><pubDate>21 Dec 2018 16:36:44 Z</pubDate><description>Merci d'avoir pris le temps de me répondre, j'ai pour consigne de base de ne pas utiliser google map. &#13;
&#13;
Pour mon problème j'ai…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222884/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222884/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev/read.awp">Recherche d'alternative à google map WINDEV</source><title>Re: Recherche d'alternative à google map WINDEV</title></item><item><author>marcelf</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222852/read.awp</comments><pubDate>21 Dec 2018 05:04:22 Z</pubDate><description>Le 20/12/2018 à 12:56, Daryl a écrit :&#13;
&gt; Salut Marcel,&#13;
&gt; &#13;
&gt; L'API Google ne doit pas être installée, mais il faut l'activer.&#13;…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222852/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222852/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev/read.awp">Recherche d'alternative à google map WINDEV</source><title>Re: Recherche d'alternative à google map WINDEV</title></item><item><author>Daryl</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222832/read.awp</comments><pubDate>20 Dec 2018 13:56:14 Z</pubDate><description>Salut Marcel,&#13;
&#13;
L'API Google ne doit pas être installée, mais il faut l'activer.&#13;
Pour cela tu vas dans ta console de dévelopeu…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222832/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222832/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev/read.awp">Recherche d'alternative à google map WINDEV</source><title>Re: Recherche d'alternative à google map WINDEV</title></item><item><author>marcelf</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222826/read.awp</comments><pubDate>20 Dec 2018 11:40:08 Z</pubDate><description>Le 20/12/2018 à 10:10, Daryl a écrit :&#13;
&gt; Salu Leozeleba,&#13;
&gt; &#13;
&gt; L'API de Google permet 100.000 requêtes gratuites toutes les 24…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222826/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222826/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev/read.awp">Recherche d'alternative à google map WINDEV</source><title>Re: Recherche d'alternative à google map WINDEV</title></item><item><author>Daryl</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222824/read.awp</comments><pubDate>20 Dec 2018 11:10:37 Z</pubDate><description>Salu Leozeleba,&#13;
&#13;
L'API de Google permet 100.000 requêtes gratuites toutes les 24 heures, tu fais plus de 100.000 requêtes par …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222824/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222824/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev/read.awp">Recherche d'alternative à google map WINDEV</source><title>Re: Recherche d'alternative à google map WINDEV</title></item><item><author>l.bories</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222778/read.awp</comments><pubDate>19 Dec 2018 10:55:49 Z</pubDate><description>J'ai modifié un peu mon code pour qu'il soit un peu plus claire : &#13;
&#13;
[code:xml]&#13;
&lt;!DOCTYPE html&gt;&#13;
&lt;html&gt;&#13;
	&lt;head&gt;&#13;
        	&lt;me…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222778/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev-222778/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/222720-recherche-alternative-google-map-windev/read.awp">Recherche d'alternative à google map WINDEV</source><title>Re: Recherche d'alternative à google map WINDEV</title></item></channel></rss>
