CMP: Mappe statiche
copia linkDescrizione
È ora possibile ottenere l'immagine di una mappa di Google grazie al nuovo metodo di sottovideata GetImageMap e generare mappe statiche grazie al nuovo metodo statico CreateImageMap della classe GoogleMaps.
Funzionalità interessate
Stampa delle mappe di Google.
Note
- Per ottenere il PDF di un book con l'immagine della mappa visualizzata in anteprima come sottovideata, occorre implementare l'evento BeforeFormatting della sezione e impostare l'immagine di sfondo della box come nell'esempio sottostante.
Esempio di codice
event Supermarket.SupermarketBook.NewReport.Detail.BeforeFormatting()
{
// Create the map of current supermarket
Supermarket s = SupermarketBook.NewReport.document
Map m = Map.newInstance(SubForm, ...)
//
// Add the marker
GeoMarker gm = s.GetMarker()
m.AddObjectToMap(gm)
m.CenterMap(gm.Latitude, gm.Longitude, 15)
//
switch (SupermarketBook.printDestination)
{
case SCREEN:
m.UpdateMap(...)
//
// Show the subform
SupermarketBook.NewReport.Mappa.setSubForm(m)
break
case PDF:
// Obtain the relative url
string filePath = m.GetImageMap([size], ...)
filePath = replace(mid(filePath, length(Application.path()) + 1, ...)
, "\\", "/")
//
// Show the image
SupermarketBook.NewReport.Mappa.setImage(filePath)
break
}
}
{
// Create the map of current supermarket
Supermarket s = SupermarketBook.NewReport.document
Map m = Map.newInstance(SubForm, ...)
//
// Add the marker
GeoMarker gm = s.GetMarker()
m.AddObjectToMap(gm)
m.CenterMap(gm.Latitude, gm.Longitude, 15)
//
switch (SupermarketBook.printDestination)
{
case SCREEN:
m.UpdateMap(...)
//
// Show the subform
SupermarketBook.NewReport.Mappa.setSubForm(m)
break
case PDF:
// Obtain the relative url
string filePath = m.GetImageMap([size], ...)
filePath = replace(mid(filePath, length(Application.path()) + 1, ...)
, "\\", "/")
//
// Show the image
SupermarketBook.NewReport.Mappa.setImage(filePath)
break
}
}
Ultima modifica: 23/03/2021 / Validità: da 13.0.5600