Добавьте слой Google «Мои карты» в API Карт Google Javascript

Так как macOS 10.7, на NSPipe есть свойство readabilityHandler, которое вы можете использовать для установки обратного вызова, когда доступны новые данные:

let task = NSTask()

task.launchPath = "/bin/sh"
task.arguments = ["-c", "echo 1 ; sleep 1 ; echo 2 ; sleep 1 ; echo 3 ; sleep 1 ; echo 4"]

let pipe = NSPipe()
task.standardOutput = pipe
let outHandle = pipe.fileHandleForReading

outHandle.readabilityHandler = { pipe in
    if let line = String(data: pipe.availableData, encoding: NSUTF8StringEncoding) {
        // Update your view with the new text here
        print("New ouput: \(line)")
    } else {
        print("Error decoding data: \(pipe.availableData)")
    }
}

task.launch()

Я удивлен, что никто не упоминал об этом , поскольку это намного проще.

21
задан Andy Mercer 30 September 2015 в 13:25
поделиться

3 ответа

You can use GGeoXml to add My Maps content to your API map.

In your My Map there's a "View in Google Earth" link, use the URL of that link as your GGeoXml URL.

The link generates an indirect "network link" reference to the data, so the map on your page will reflect the latest changes made to the My Map.

The downside is that there's a limit to how many markers you can place on one page of a My Map, and the "View in Google Earth" link only returns data for the current My Maps page.

6
ответ дан 29 November 2019 в 22:14
поделиться

Another strategy is to use GeometryControls in your own API map.

That involves a lot more coding effort on your side. It gives the same look and feel to your co-workers, so they still need no programming skills. The advantage is that it bypasses the My Maps limit to the number of markers that can be displayed at once.

1
ответ дан 29 November 2019 в 22:14
поделиться

Очевидно, вы можете встроить созданную вами карту на свой веб-сайт, используя ссылку на эту страницу функциональность, как описано здесь .

-1
ответ дан 29 November 2019 в 22:14
поделиться
Другие вопросы по тегам:

Похожие вопросы: