Has anyone have example of Google maps for multipl...
# multiplatform
d
Has anyone have example of Google maps for multiplatform, I am trying to integrate Google maps with multiplatform in iOS I am facing an issue where I have added the maps but delegate callback is not working when I am scrolling/dragging the map, I wanted to get the lat lng from centre of the map for iOS
m
I've not used Google Maps, but most iOS delegates are held by weak reference, so if you are not holding onto your own copy of the delegate, the callbacks stop working.
👍 1
d
Btw is there any CMP map SDK ? I know about Mapbox , but it’s not multiplatform , it’s only for android
m
I've built a KMP (Android and iOS) library for The Weather Company for animating data on a map. The main engine that it works on is Mapbox. It's not CMP (not even Compose), but I have built CMP test apps using it. A CMP module for it is desired, but not scheduled. It's mostly being used internally and the company is still figuring out pricing and licensing for external customers. But if interested, I can find out if there is a client rep, that I could direct you to.
d
I would be interested to see, thanks. There is a lack of libraries on CMP, and maps - is one of it.
👍 1
d
👍 1
m
@Dumitru Preguza I mentioned your interest to my manager. I'm not connected to sales, and I don't know where along they are on the plans for how to sale the library, but I'll let you know if I hear anything.
👍 1
d
@Dennis the repo you mentioned is great but not what I am looking for, I just want the callback whenever user stops dragging/scrolling the maps so that I can get the location from centre of Google maps view
s
> Btw is there any CMP map SDK ? > There's https://github.com/maplibre/maplibre-compose (I'm the maintainer)
d
@Sargun Vohra Thanks for the library! I found it after some searching and had a few questions: • Is it possible to change the font style? The current one looks a bit pixelated. • Can new native-looking places be added to the map? I’d also like to make map labels interactive—e.g., increase their size and change color when clicked, to make them feel more clickable. • Custom place search integration: If someone wanted to implement a custom place search (such as a semantic search tailored to user profiles or application-specific algorithms), would it be possible to integrate their own search engine into the MapLibre frontend? Someone recommended the Overpass API for this use-case. I’d love to hear your thoughts on how such a feature could be implemented—especially in terms of architecture and best practices for integrating custom search logic with MapLibre. • Additionally, to improve the developer experience, it would be helpful to have more detailed guidance on integrating the library with CMP for iOS targets. I spent quite a bit of time getting it set up using the SPMforKMP plugin from @François (though to be fair, I’m new to KMP, CMP, Map SDKs, and Android in general, it's not my stack). Even after getting it working, I saw some console warnings, and the map on iOS looked quite different—just a colorful base map without roads or labels. On Android, however, it displayed correctly with roads, labels, and much more detail. I really appreciate the work on this library—just sharing a few observations from my short experience so far.
s
> Is it possible to change the font style? The current one looks a bit pixelated. Yes, see the JSON style spec: https://maplibre.org/maplibre-style-spec/. The map renders whatever style you provide, including data sources, layers, glyphs, fonts, sprites, etc. Which stylejson did you use? If you don't provide a style, the default is https://demotiles.maplibre.org/. I personally like the styles available at https://protomaps.com/. Another free provider that's very easy to get started with is https://openfreemap.org/. > Can new native-looking places be added to the map? You can add additional sources and layers to the style programmatically via a declarative Compose DSL, and they have all the same styling options available via the JSON base style > Custom place search integration The library renders whatever data you give it; it's not opinionated about what location search API you use. You could create a GeoJsonSource, populate it with Point features of your search results, and pass that source to a CircleLayer to render those search results as circles on the map. Or to a SymbolLayer to render them as icons or text. Or combine them for more complex styling (that's exactly how the base map styles are built). > it would be helpful to have more detailed guidance on integrating the library with CMP for iOS targets. That's probably best done by improving the SPM4KMP documentation rather than cloning it in MapLibre Compose documentation. We do however have a fully functioning example configuration in the demo app. But yeah, our docs are barebones right now and do need improvement, especially for folks who haven't worked with MapLibre or Mapbox before. Feel free to PR improvements to the docs, or create issues / discussions in the repo on whatever is confusing. > the map on iOS looked quite different—just a colorful base map without roads or labels If you gave it the same style URL on both but it rendered a different base map, that's probably a bug. Please file an issue.
👍🏻 1
thank you color 1