有问题的Javascript:
var md = window.markdownit();
var result = md.parse( document.querySelector('#markdown-content').textContent, {} );
我认为我必须添加,但不确定在哪里,甚至如何:
function myMap() {
var mapOptions1 = {
center: new google.maps.LatLng(42.9814362, -81.2267205),
zoom:15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var mapOptions2 = {
center: new google.maps.LatLng(42.9421287, -81.2284421),
zoom:15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map1 = new google.maps.Map(document.getElementById("googleMap1"),mapOptions1);
var map2 = new google.maps.Map(document.getElementById("googleMap2"),mapOptions2);
}
答案 0 :(得分:1)
您应为每张地图上的每个标记分配一个有效的中心
function myMap() {
var mapOptions1 = {
center: new google.maps.LatLng(42.9814362, -81.2267205),
zoom:15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var mapOptions2 = {
center: new google.maps.LatLng(42.9421287, -81.2284421),
zoom:15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map1 = new google.maps.Map(document.getElementById("googleMap1"),mapOptions1);
var map2 = new google.maps.Map(document.getElementById("googleMap2"),mapOptions2);
var marker1 = new google.maps.Marker({
position: new google.maps.LatLng(42.9814362, -81.2267205)
});
marker1.setMap(map1);
var marker2 = new google.maps.Marker({
position: new google.maps.LatLng(42.9421287, -81.2284421)
});
marker2.setMap(map2);
}
答案 1 :(得分:0)
为了将来参考,我想出来了。
function myMap() {
var mapOptions1 = {
center: new google.maps.LatLng(42.9814362, -81.2267205),
zoom:15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var mapOptions2 = {
center: new google.maps.LatLng(42.9421287, -81.2284421),
zoom:15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map1 = new google.maps.Map(document.getElementById("googleMap1"),mapOptions1);
var latlong = {lat: , lng: }; // Insert your map marker lat/long here
var marker = new google.maps.Marker({
position: latlong,
map: map1,
title: 'Hello World'
});
var map2 = new google.maps.Map(document.getElementById("googleMap2"),mapOptions2);
var latlong = {lat: , lng: }; // Insert your map marker lat/long here
var marker = new google.maps.Marker({
position: latlong,
map: map2,
title: 'Hello World'
});
}