Code Monkey home page Code Monkey logo

mapssdk-native's Introduction

Welcome to the Bing Maps SDK for Android and iOS!

Feature requests and bug reports are very much welcome at the issues page. Your insights and scenarios are critically important to us.

Overview

The Bing Maps SDK for Android and Bing Maps SDK for iOS are libraries for building mapping applications for Android and iOS. The SDKs feature a native map control and an accompanying map services API set.

The map control is powered by a full vector 3D map engine with a number of standard mapping capabilities including displaying icons, drawing polylines and polygons, and overlaying texture sources. This engine brings in the same 3D Native support you know from our XAML Map Control in Windows 10, including worldwide 3D elevation data (via our Digital Elevation Model).

The native controls and map services API set will continue to mature and stabilize in future SDK releases!

Getting started

For instructions to download and setup the sample apps, check out the Getting Started page on the wiki.

The wiki also contains documentation, links to the API reference, and an in-depth overview of a few common scenarios showcased in the sample app for Android and iOS.

What is in this repo?

This repository includes samples, documentation and release history.

The core source code for the native controls is not part of this repository.

  • The Bing Maps SDK for Android is available here.
  • The Bing Maps SDK for iOS is available here.

The Bing Maps SDK for Android and Bing Maps SDK for iOS are licensed under Microsoft Bing Map Platform APIs Terms of Use.

Contributing

Contributions to the documentation and supporting samples are welcome. Please refer to the Contribution Process for more details.

Data Collection / Telemetry

This project collects usage data and sends it to Microsoft to help improve our products and services. Read our Privacy Notice to learn more. Telemetry is disabled in the Bing Maps SDK for Android and Bing Maps SDK for iOS by default, and can be enabled with the API.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

mapssdk-native's People

Contributors

beccai avatar cai22r avatar juanpapas avatar khass891891 avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar razvanra2 avatar rkoten avatar wydavis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mapssdk-native's Issues

Polyline strokeWidth cannot be changed

Using the example from the following Microsoft article the strokeWidth cannot be overridden.

Link to article

func drawLineOnMap() {
    let center = self.mapView.mapCenter.position

    let geopath = MSGeopath(positions:
        [MSGeoposition(latitude: center.latitude-0.0005, longitude: center.longitude-0.001),
         MSGeoposition(latitude: center.latitude+0.0005, longitude: center.longitude+0.001)])

    let mapPolyline = MSMapPolyline()
    mapPolyline.path = geopath
    mapPolyline.strokeColor = UIColor.black
    mapPolyline.strokeWidth = 3 // 3 marked in the example but always reverts to 1
    mapPolyline.strokeDashed = true

    // Add Polyline to a layer on the map control.
    let linesLayer = MSMapElementLayer()
    linesLayer.zIndex = 1
    linesLayer.elements.add(mapPolyline)
    mapView.layers.add(linesLayer);
}

iOS Dark mode, demo app

iOS 13, DarkMode

  1. UIPickerView background color, to fix -> Main.Storyboard -> Choose the picker -> Attribute Inspector -> Background Color -> System Background

How to show all pushin.

How to show all the pushin points, like Bing map in web side , is there any property for this like MapFit.

Map Integration Issue: Dependencies have been successfully built, but we are still unable to use the MapView.

Hello Team,

I hope this message finds you well. I've diligently followed the steps outlined in the Android SDK for MapView integration. The code has been successfully built; however, I'm encountering difficulties using the MapView.

Upon reviewing the build log, it appears that Maven is not found. I've attached a screenshot for your reference.

`> Task :prepareKotlinBuildScriptModel UP-TO-DATE
Download https://microsoftmaps.jfrog.io/artifactory/Maven/com/microsoft/maps/maps-sdk/1.2.0/maps-sdk-1.2.0.pom.sha1, took 1 s 704 ms (11.53 kB)
Download https://microsoftmaps.jfrog.io/artifactory/Maven/com/microsoft/maps/maps-sdk/1.2.0/maps-sdk-1.2.0.pom, took 1 s 110 ms (11.53 kB)
[Fatal Error] maps-sdk-1.2.0.pom:2:10: Already seen doctype.
[Fatal Error] maps-sdk-1.2.0.pom:2:10: Already seen doctype.
[Fatal Error] maps-sdk-1.2.0.pom:2:10: Already seen doctype.
[Fatal Error] maps-sdk-1.2.0.pom:2:10: Already seen doctype.
[Fatal Error] maps-sdk-1.2.0.pom:2:10: Already seen doctype.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 13s`

WhatsApp Image 2023-12-18 at 5 32 48 PM (1)
WhatsApp Image 2023-12-18 at 5 32 48 PM

Can't click on marker

Hello,

I just integrated the Bing maps SDK for Android on the app I'm currently working on and can't find a way to detect the click event on the marker icon.
I already tried to detect the click on the MapView and match it with the existing markers, with no success.
I also made some experiments with the FlyOut with no success.

Is this functionality implemented?

Emulator crash on targetSdkVersion 29

Emulator and app crash when setting targetSdkVersion 29 and when fragment resume
public override fun onResume() {
super.onResume()
mMapView!!.onResume()

}

On real device it works fine but on emulator it crashes.
I am using android studio 4.+

Multiple memory leaks

Screen Shot 2020-05-06 at 2 37 50 PM

**Describe the bug** If I repeatedly set the path property on a MSMapPolyline (10x per second), the app memory slowly increased (1-2mb / sec).

Steps to reproduce

  1. Create an MSMapPolyline and add it to the map
  2. Create a Timer at 0.1s interval
  3. Set the path property in the timer callback with a new MSGeopath with an increasing number of positions
  4. Watch your memory footprint increase

Expected behavior
Either have a way to append positions to the path, or free up the memory from previously updated paths.

Screenshots
Screen Shot 2020-05-06 at 2 37 50 PM

Device and SDK information (please complete the following):

  • OS version: iOS 13.4.1
  • Architecture: arm64
  • Bing Maps SDK version: 1.1.0
  • Language: English
  • Region: US

Additional context
None

map streets text direction

How do I change the display direction of the street's name on a phone which is in Hebrew(RTL)?
The current issue is that the street's display name is LTR and then it's misunderstood on our screen.

device-2020-04-01-154649

Thank in advance.

Bitcode and build upload error

While using Bing Map iOS SDK version0.2.0 in our project and Bitcode is enabled then, Product doesn't Archive, so we are unable to make a build.

When we disable the Bitcode at this time Product is Archived successfully, but while upload this on Appstore we are getting unexpected "CFBundleExecutableKey" error.
Please provide a solution for this.
image001
image002

Android MapRenderMode.RASTER do not affects any changes after application restart

I need to turn off 3d drawing on Bing maps. I'm using Bing android sdk version "com.microsoft.maps:maps-sdk:1.2.0".
MapView has mapStyleSheet aerial or aerialWithOverlay.
To turn off 3d view and to draw map in 2d I'm setting MapRenderMode.RASTER to MapView (in constructor or with setter).
But after application restart map is drawing in 3d and don't seem to apply any changes.
I've tried to set isBuildingsVisible=false but it also was not working for me.

Rolling back to "com.microsoft.maps:maps-sdk:1.1.0" helped me, on old sdk version bug is not reproducible.

Steps to reproduce

  1. Install application with bing maps sdk
  2. Go to screen with map
  3. Zoom to maximum to any location in any city.
  4. On current step map is drawing in 2d view as it should:

image
image

  1. Close or kill application
  2. Run application again
  3. Open screen with map and zoom in to location.

Expected result: map is drawing in 2d view.
Actual result: map starts to draw in 3d view. Setting render mode to raster not working:
image
image

Testing devices:
Device: Samsung Galaxy Tab S2
OS: 7.0
Device: Samsung Galaxy Tab S7
OS: 11.0
Device: Galaxy S8
OS: 9.0
Device: Xiaomi mi 9 SE
OS: 10.0

Device where bug was not reproduced:
Device: Samsung Galaxy Tab A SM-T555
OS: 7.1.1

Aerial mode cannot be displayed on the iPad

Hello:
MSMapView on iPhone MSMapStyleSheets.aerial() styleSheet displays normally. It cannot be displayed on the iPad, it is all black, and the MSMapStyleSheets.aerialWithOverlay() styleSheet on the iPad only displays Overlay.
Can you help me out?

Map displays as a blue frame (Android Studio)

Hello,

I followed the step-by-step instructions provided here https://docs.microsoft.com/en-us/bingmaps/sdk-native/getting-started-android/ and my up doesn't crash when I load the emulator but the map itself doesn't work, it just displays as a blue frame. I can see the controls and the MS Corporation watermark but there is no map. I tried to render it as VECTOR and as RASTER but neither works, I get the same result.

mMapView = new MapView(this, MapRenderMode.RASTER); // or use MapRenderMode.RASTER for 2D map mMapView.setCredentialsKey(BuildConfig.CREDENTIALS_KEY); ((FrameLayout)findViewById(R.id.bing_map_view)).addView(mMapView); mMapView.onCreate(savedInstanceState);

And this is the end result.

image

The only error I get in the log when I click on the blue area or the controls is this E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5

Any ideas on how to make this work?

OnMapLongClickListener

Hi,

I'm trying to implement long click on map.

There is a:

  • addOnMapTappedListener,
  • addOnMapDoubleTappedListener,

but there is no equivalent of addOnMapLongClickListener.

Is there any way to implement OnMapLongClickListener?

Occasionally, errors may occur when reopening the application: Abort message: 'std::terminate called inside BingMaps

    #00  pc 00000000001ce31c  /data/app/com.billy.watch-X1dpQB9NNbQN3eZ7uDZUmw==/lib/arm64/libBingMaps.so
    #01  pc 00000000001dbda4  /data/app/com.billy.watch-X1dpQB9NNbQN3eZ7uDZUmw==/lib/arm64/libBingMaps.so
    #02  pc 00000000008b1344  /data/app/com.billy.watch-X1dpQB9NNbQN3eZ7uDZUmw==/lib/arm64/libBingMaps.so
    #03  pc 00000000008b12ec  /data/app/com.billy.watch-X1dpQB9NNbQN3eZ7uDZUmw==/lib/arm64/libBingMaps.so (_ZSt9terminatev)
    #04  pc 0000000000673dfc  /data/app/com.billy.watch-X1dpQB9NNbQN3eZ7uDZUmw==/lib/arm64/libBingMaps.so
    #05  pc 0000000000673c04  /data/app/com.billy.watch-X1dpQB9NNbQN3eZ7uDZUmw==/lib/arm64/libBingMaps.so (Java_com_microsoft_maps_MapSurface_getAccessibleMapPoiInternal)
    #06  pc 0000000000151354  /apex/com.android.runtime/lib64/libart.so
    #07  pc 0000000000148338  /apex/com.android.runtime/lib64/libart.so
    #08  pc 00000000001571b8  /apex/com.android.runtime/lib64/libart.so (_ZN3art9ArtMethod6InvokeE'

3D Textured Buildings in Mobile SDK

First off, thanks for a great SDK! It was extremely easy to get up and going.

One question though: the Windows 10 Maps application has highly detailed textured 3D buildings when you select aerial mode (
desktop_maps_3D_aerial_buildings_seattle
), even allowing you to tilt to see the horizon.

Running the SDK example app, I can see the terrain in 3D along with textures on the ground when selecting aerial mode but no buildings in 3D, providing a falsely flat textured terrain (
IMG_0395
). When I select one of the Road options I get buildings, but only rough outlines with no textures (
IMG_0396
) My guess is those buildings are based on the Microsoft contribution to OpenMap ( https://wiki.openstreetmap.org/wiki/Microsoft_Building_Footprint_Data ). Is there a way to get the same style 3D buildings possible in the Desktop Maps app in the iOS SDK? Is there any other SDKs where you can access the same detailed 3D buildings?

Set globe size property / function

When using the globe projection the globe does not fit the view on many devices. I want make sure that the full globe is visible. On Android the globe size seems to be based on just screen density which makes it easy to just scale down the view to fit the screen. However on iOS the globe scale seems to be dependent on the initial starting frame size somehow, not fully figured it out jet as the library is pretty much a black box.

All these problems with trying to scale the view just to make the globe to be fully in frame could easily be solved if we just had a way to set the globe size in a property on the map.

Please add a Jetpack Compose sample

Problem
The current sample features an "old" way of developing for Android. Yes, this approach is still valid and works like a charm, but it would be great to adopt to the future and provide samples using Kotlin and Jetpack Compose

Example

// MARK: - Internal composable views -

@Composable
fun BingMap(lat: Double, lng: Double) {
    val map = rememberBingMapViewWithLifecycle()
    BingMapContainer(map = map, lat = lat, lng = lng)
}

// MARK: - Private composable views -

@Composable()
private fun BingMapContainer(map: MapView, lat: Double, lng: Double) {

    LaunchedEffect(map) {
        val point = Geopoint(lat, lng)
        map.setScene(MapScene.createFromLocation(point), MapAnimationKind.NONE)
    }

    val coroutineScope = rememberCoroutineScope()

    AndroidView(factory = { map }) {
        coroutineScope.launch {
            it.centerTo(lat = lat, lng = lng)
        }
    }
}

@Composable
private fun rememberBingMapViewWithLifecycle(): MapView {
    val context = LocalContext.current
    val map = remember { MapView(context) }
    map.setCredentialsKey(CREDENTIALS_KEY)

    val observer = rememberBingMapViewLifecycleObserver(map)
    val lifecycle = LocalLifecycleOwner.current.lifecycle

    DisposableEffect(lifecycle) {
        lifecycle.addObserver(observer)

        onDispose {
            lifecycle.removeObserver(observer)
        }
    }

    return map
}

@Composable
private fun rememberBingMapViewLifecycleObserver(map: MapView): LifecycleEventObserver {
    return remember(map) {
        LifecycleEventObserver { _, event ->
            when (event) {
                Lifecycle.Event.ON_START -> map.onStart()
                Lifecycle.Event.ON_STOP -> map.onStop()
                Lifecycle.Event.ON_DESTROY -> map.onDestroy()
                else -> Unit // nop
            }
        }
    }
}

// MARK: - Extension -

fun MapView.centerTo(lat: Double, lng: Double) {
    val point = Geopoint(lat, lng)
    setScene(MapScene.createFromLocation(point), MapAnimationKind.NONE)
}

[Feature request] Support arm64-v8a

Problem

The Bing Map SDK only support armeabi-v7a, x86 currently, because our APP support 64-bit devices, so it will cause the crash on the 64-bit devices

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/xxxx/base.apk"],nativeLibraryDirectories=[/data/app/xxxxx/lib/arm64, /data/app/xxx!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "libBingMaps.so"

actually, we can force our APP to compatible the Bing Map SDK by setting abiFilters 'armeabi-v7a', 'x86' but that may let our APP can't upload the Google Play after August 1, 2019 https://android-developers.googleblog.com/2019/01/get-your-apps-ready-for-64-bit.html, and lost performance improvements for the 64-bit devices.

Proposal

Make the Bing Map SDK support arm64-v8a architectures.

Describe alternatives you have considered

Screenshots

Additional context

Not able load Bing maps on android

I tried to integrate bing maps into an android app but I tried to open the view I get the following error

2022-04-06 11:55:54.906 1671-1671/com.microsoft.modules A/BingMaps: std::terminate called inside BingMaps
#00 pc 00000000001eadb9 /data/app/~~ON5P6d0o8QtzVE12_r05Ig==/com.microsoft.modules-ZJlZ9F_5UpQsZzOcodshTQ==/lib/x86_64/libBingMaps.so
#1 pc 00000000001fa557 /data/app/~~ON5P6d0o8QtzVE12_r05Ig==/com.microsoft.modules-ZJlZ9F_5UpQsZzOcodshTQ==/lib/x86_64/libBingMaps.so
#2 pc 000000000096c5e3 /data/app/~~ON5P6d0o8QtzVE12_r05Ig==/com.microsoft.modules-ZJlZ9F_5UpQsZzOcodshTQ==/lib/x86_64/libBingMaps.so
#3 pc 000000000096c588 /data/app/~~ON5P6d0o8QtzVE12_r05Ig==/com.microsoft.modules-ZJlZ9F_5UpQsZzOcodshTQ==/lib/x86_64/libBingMaps.so (_ZSt9terminatev)
#4 pc 000000000017f592 /data/app/~~ON5P6d0o8QtzVE12_r05Ig==/com.microsoft.modules-ZJlZ9F_5UpQsZzOcodshTQ==/lib/x86_64/libBingMaps.so
#5 pc 00000000006f779c /data/app/~~ON5P6d0o8QtzVE12_r05Ig==/com.microsoft.modules-ZJlZ9F_5UpQsZzOcodshTQ==/lib/x86_64/libBingMaps.so
#6 pc 00000000006eef22 /data/app/~~ON5P6d0o8QtzVE12_r05Ig==/com.microsoft.modules-ZJlZ9F_5UpQsZzOcodshTQ==/lib/x86_64/li

I get the same error when I run the sample app too

How to drag and drop the MapIcon?

Is it possible to drag-n-drop the MapIcon items?
If no, is there any other way to allow the user to move the pushpin on the map?

Thanks.

Xamarin Android support/documentation

How do I Use bing maps sdk on xamarin android? There is no tutorial/documentation related to this? Do i just need to port the library/do the Xamarin bindings myself?

iOS Demo App, all Modes

MapView's constraints.

Main.storyboard -> MapView -> Size Inspector ->

  1. Align Leading to: Safe Area 1 -> 0
    2.Top Space to Superview : 1 -> 0
  2. Align Trailing to SafeArea: 1 -> 0
  3. Align Bottom to Safe Area 1 -> to Superview 0

Unable to build on Apple M1 chips: no arm64 architecture for MicrosoftMaps

Hello, not sure if I am reporting on correct place, so sorry if not.
We have a problem to build our aplication on MacBook's with M1 procesors, when we try import MicrosoftMaps SDK via pods

We are getting this error:
building for iOS Simulator, but linking in dylib built for iOS, file '/Pods/MicrosoftMapsSDK/MicrosoftMaps.framework/MicrosoftMaps' for architecture arm64

Any suggestion or chance, that SDK will be supported for architecture arm64?

Could not parse POM https://microsoftmaps.jfrog.io/artifactory/Maven/com/microsoft/maps/maps-sdk/1.2.0/maps-sdk-1.2.0.pom

Not sure if this is a right place. So, apologize if not. However, we have the problem during build to download the latest version of the library. We obtain this error:

Could not parse POM https://microsoftmaps.jfrog.io/artifactory/Maven/com/microsoft/maps/maps-sdk/1.2.0/maps-sdk-1.2.0.pom

Have you changed the repository, have you changed the library version (in README is mentioned version 1.2.0)?

Thank you.

Axe tool reporting accessibility issues on Map

Hi,
There are accessibility issues reported by axe tool on Map. Please advise a fix on them or suggest if something can be done by us.
Issues with role attribute :
Description:
Ensures role attribute has an appropriate value for the element
Fix any of the following:
ARIA role button must be removed when the element is made visible, as it is not allowed for the element
image
image

Color contrast issues:
Description:
Ensures the contrast between foreground and background colors meets WCAG 2 AA contrast ratio thresholds
Fix any of the following:
Element's background color could not be determined because element contains an image node
Screen shots:
image

image

image

image

image

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.