![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
|||
|
|||
|
Hola Leo! Muchísimas gracias! ahora funciona!
Por si le sirve de algo a alquien: Al cargar el mapa me he encontrado con un error de javascript, más en concreto onion.js. Leyendo me he encontrado que dicha librería utiliza funciones de JSON. Bastaría con añadir Código:
<script src="https://cdn.jsdelivr.net/json3/3.3.2/json3.js"></script> Código:
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="https://cdn.jsdelivr.net/json3/3.3.2/json3.js"></script>
<script type="text/javascript">
var geocoder;
var map;
var markersArray = [];
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(40.714776,-74.019213);
var myOptions = {
zoom: 13,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
map.set("streetViewControl", false);
google.maps.event.addListener(map, "click",
function(event)
{
document.getElementById("LatValue").value = event.latLng.lat();
document.getElementById("LngValue").value = event.latLng.lng();
PutMarker(document.getElementById("LatValue").value, document.getElementById("LngValue").value,"")
}
);
}
function GotoLatLng(Lat, Lang) {
var latlng = new google.maps.LatLng(Lat,Lang);
map.setCenter(latlng);
}
function ClearMarkers() {
if (markersArray) {
for (i in markersArray) {
markersArray[i].setMap(null);
}
}
}
function PutMarker(Lat, Lang, Msg) {
var latlng = new google.maps.LatLng(Lat,Lang);
var marker = new google.maps.Marker({
position: latlng,
map: map,
title: Msg+" ("+Lat+","+Lang+")"
});
markersArray.push(marker);
index= (markersArray.length % 10);
if (index==0) { index=10 }
icon = "http://www.google.com/mapfiles/kml/paddle/"+index+"-lv.png";
marker.setIcon(icon);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
<div id="latlong">
<input type="hidden" id="LatValue" >
<input type="hidden" id="LngValue" >
</div>
</body>
</html>
|
|
#2
|
|||
|
|||
|
Completo con lo que faltaba que es poder ejecutar funciones JavaScript y que he encontado por ahi y rula
Código:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
IHTMLDocument2 *doc = NULL;
IHTMLWindow2 *win;
if(SUCCEEDED(WebBrowser1->Document->QueryInterface(IID_IHTMLDocument2, (LPVOID*)&doc))) {
HRESULT hr = doc->get_parentWindow(&win);
if (SUCCEEDED(hr)) {
BSTR cmd = L"ClearMarkers()";
VARIANT v;
VariantInit(&v);
win->execScript(cmd,NULL,&v);
VariantClear(&v);
win->Release();
}
doc->Release();
}
Código:
void __fastcall TForm1::Button2Click(TObject *Sender)
{
IHTMLDocument2 *doc = NULL;
IHTMLWindow2 *win;
if(SUCCEEDED(WebBrowser1->Document->QueryInterface(IID_IHTMLDocument2, (LPVOID*)&doc))) {
HRESULT hr = doc->get_parentWindow(&win);
if (SUCCEEDED(hr)) {
String str = String("GotoLatLng(") + Edit1->Text + "," + Edit2->Text + ")";
VARIANT v;
VariantInit(&v);
win->execScript( str.w_str(), NULL, &v );
VariantClear ( &v );
win->Release ();
}
doc->Release();
}
}
|
|
#3
|
||||
|
||||
|
Cita:
Código:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION Código:
SustituirPorElNombreDeTuEjecutable.exe (REG_DWORD) 11001 (valor decimal) |
|
#4
|
|||
|
|||
|
Algo había leído al respecto... hace un rato buscando he encontrado esto:
https://msdn.microsoft.com/es-es/library/cc817574.aspx Maneras de activar los modos de compatibilidad. Estoy utilizando esto: Código:
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
|
#5
|
||||
|
||||
|
Fue lo primero que probé, pero lo ignora totalmente, al menos en Windows10.
|
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Api de google , google maps en c++ builder 6 | JM1985 | C++ Builder | 1 | 01-04-2016 21:10:17 |
| GPS y Google Maps | MAXIUM | Internet | 5 | 15-03-2011 18:15:05 |
| Google Maps | madiazg | Varios | 4 | 26-10-2008 22:03:41 |
| Google maps y php | halizia | PHP | 2 | 16-03-2007 17:04:49 |
| Google Maps .es | Neftali [Germán.Estévez] | Noticias | 0 | 27-04-2006 13:32:54 |
|