Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Pakiet SDK Map na iOS w wersji 3.10.0 Beta zawiera te nowe funkcje:
Definiowanie stylów map w Google Cloud/dostosowywanie map
Dostosowywanie linii łamanych: odbite linie łamane
Definiowanie stylów map w Google Cloud (wersja beta)
Możesz teraz tworzyć style niestandardowe i przypisywać je do map w swoich aplikacjach i witrynach za pomocą tokenów. Więcej informacji znajdziesz w artykule Omówienie dostosowywania Map na iOS.
Dostosowywanie linii łamanych: odbite linie łamane
Za pomocą atrybutu GMSTextureStyle możesz ustawić wygląd ścieżki wielokąta na powtarzającą się bitmapową teksturę.
Obrazy obejmują linię w pełni, ale będą przycięte w okolicach punktów końcowych i wierzchołków.
Aby utworzyć odbitą ścieżkę poliliniową, utwórz GMSStampStyle z GMSTextureStyle.
Następnie ustaw tę właściwość w obiekcie opcji kształtu, używając stampStyle, jak pokazano poniżej:
Swift
letpath=GMSMutablePath()path.addLatitude(-37.81319,longitude:144.96298)path.addLatitude(-31.95285,longitude:115.85734)letpolyline=GMSPolyline(path:path)letredWithStamp=GMSStrokeStyle.solidColor(.red)letimage=UIImage(named:"imageFromBundleOrAsset")!// Image could be from anywhereredWithStamp.stampStyle=GMSTextureStyle(image:image)letspan=GMSStyleSpan(style:redWithStamp)polyline.spans=[span]polyline.map=mapView
Objective-C
GMSMutablePath*path=[GMSMutablePathpath];[pathaddLatitude:-37.81319longitude:144.96298];[pathaddLatitude:-31.95285longitude:115.85734];GMSPolyline*polyline=[GMSPolylinepolylineWithPath:path];GMSStrokeStyle*redWithStamp=[GMSStrokeStylesolidColor:[UIColorredColor]];UIImage*image=[UIImageimageNamed:@"imageFromBundleOrAsset"];// Image could be from anywhereredWithStamp.stampStyle=[GMSTextureStyletextureStyleWithImage:image];GMSStyleSpan*span=[GMSStyleSpanspanWithStyle:redWithStamp];polyline.spans=@[span];polyline.map=mapView;
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-06-13 UTC."],[[["The Beta version of the Maps SDK for iOS is being deprecated and will be decommissioned; features accessed through it will be supported in a future SDK version."],["This Beta release (v3.10.0) introduces Cloud-Based Map Styling for customizing maps in apps and websites."],["This release also includes Polyline Customization, allowing developers to apply repeating bitmap textures to polylines using `GMSTextureStyle`."]]],["The Beta SDK is deprecated and unavailable for new use. The Maps SDK for iOS v3.10.0 Beta introduces cloud-based map styling, allowing custom style creation and token assignment. It also introduces stamped polyline customization. To create a stamped polyline, a `GMSStampStyle` of `GMSTextureStyle` must be created and applied to the shape's options using `stampStyle`. Code examples in Swift and Objective-C demonstrate setting a repeating bitmap texture on a polyline.\n"]]