nativescript-mapbox showing black Map Markers - android

I am having an issue in the android emulator where my svg/icon Layers are showing as black. This sometimes effects highway/road markers as well as my map markers. The plugin is currently using the default marker, but I have also provided my own png file and they both suffer from this problem.
Sometimes zooming in will fix it (as can be seen for one of the markers in the image below)
I am yet to test this on any other device and have only been using an android emulator from android studio.
Some extra details
I am running nativescript with Angular (and TS), I have commented out any extraneous code that adds markers etc and am still having the issue on highway number markers (example below). Here is my template:
<StackLayout class="page">
<ContentView height="100%" width="100%">
<Mapbox
accessToken="token"
mapStyle="streets"
[latitude]=defaultLocation.latitude
[longitude]=defaultLocation.longitude
hideCompass="true"
zoomLevel="8"
showUserLocation="false"
disableZoom="false"
disableRotation="false"
disableScroll="false"
disableTilt="false"
(mapReady)="onMapReady($event)">
</Mapbox>
</ContentView>
</StackLayout>
It seems like I can trigger this with a call to removeMarkers and addMarkers with this code:
updateUserMarker(loc) {
console.log("updating user location marker with loc: ", loc)
this.map.removeMarkers([this.userMarker.id]);
this.userMarker.lat = loc.latitude;
this.userMarker.lng = loc.longitude;
this.map.addMarkers([this.userMarker]);
}

I had the same problem and I removed Android Studio and reinstalled and downloaded a new OS image and it seems to have fixed the problem.
Not sure you still have this issue but thought I would put this here for any new users with the issue as this was the only post I could find relating to this.

If you are running this on an emulator then make sure to go to it's settings and select the following :
OpenGL ES renderer as "SwiftShader"
OpenGL ES API Level as "Renderer maximum"
and restart the android emulator.

Related

SVG images is not showing in Nativescript

I am trying to use svg images for android in native-script. Here is my code
<StackLayout xmlns:svg="#teammaestro/nativescript-svg">
<svg:SVGImage src="~/images/app_settings.svg" height="250" width="250" /> </StackLayout>
I am using this native-script plugin . However I am not getting any error. But the images are not showing in android emulator.
Finally, I solved this issue on my side.
Firstly, I use this package from SergeyMell: nativescript-svg. Those two packages are very similar since they both forked this same package peoplewareDo/-nativescript-svg.
I moved all the SVG files from App_Ressources to an assets folder in the app folder.
Then I added this line in webpack.config.js:
{ from: '**/*.svg', noErrorOnMissing: true, globOptions: { dot: false, ...copyIgnore } }
Finally,
<SVGImage src="~/assets/file.svg"></SVGImage>
This answer is not a big thing but now it's working fine for my project. Some of the steps were already done and the big changes are the folders move. Perhaps Android ignores for some conditions some files from App_Resources.
I hope it'll help as it worked for me.

HERE Maps on Android freezes browser, breaking ajax requests on iOS

I am using HERE Maps to show a map letting users choose a location of interest. It works fine on desktop, but on mobile devices I am experiencing some problems.
On Android devices, if I create a map using
var map = new nokia.maps.map.Display(document.getElementById("map"), {
// Initial center and zoom level of the map
center: startCoordinate,
zoomLevel: 5,
components: [
new nokia.maps.map.component.Behavior(),
new nokia.maps.map.component.ZoomBar(),
new nokia.maps.map.component.ScaleBar()
]
}
);
the browser freezes after a few seconds. You can test this at karmap.com; try to scroll down to the very bottom to find the map. If I remove the code shown above the browser won't freeze anymore (but I won't get the map, of course).
Another problem occurs, when loading the page on iOS devices; in the form at the bottom you can find an input box named "Place of Birth". After typing 3 letters or more I start an ajax request to find suitable city names. This doesn't work if I use the following code (right under the code snippet to create the map):
map.removeComponent(map.getComponentById("zoom.MouseWheel"));
map.set("baseMapType", map.SATELLITE); // Activates satellite imagery on the display
If I comment that code out, the ajax calls work fine.
For me, that is some strange side effect! Does anyone have a clue what is going on?
Thanks for any help or advice!

Infowindow bug in android browser. Sencha touch

I'm Using sencha Architect (sencha touch 2) and when creating a simple infowindow in a google map it displays all the google controls (undo arrow, +, -, zoom controls) next to the closing 'x'.
This only bugs in android (4.0.3) browser, in chrome or firefox on my pc works fine.
I uploaded the Sencha Architect project here
Here's the code for creating and displaying the infowindow.
var map = this.getGoogleMap().getMap();
var center = map.getCenter();
var iw = new google.maps.InfoWindow();
iw.setContent('<p> Test </p>');
iw.setPosition(center);
iw.open(map);
Any ideas on why is this happening?
EDIT:
Here's how it looks
I got rid of the unwanted icons by adding 2 br tags after the content.
Like so: "iw.setContent('Test [br][br]');" (The [] must be replaced with a <>)
This bug came with the last google maps update aprox. a month ago.

Why do I get a strange blank screen error with OpenGLes/Android/NDK?

I'm getting a very weird error ever since I have "ported" the spritebatch code from Nokia's site. It runs well as a desktop applcation emulated by POWERVR. But on Android I only get a blank screen (in fact its black.) This happens if I just try to display a image, but it doesn't crash.
Here is where comes the weird part comes in: if i put glGeterror(); in the update function it works fine! (slowly, but displays everything fine) and geterror code returns 0. I have no idea what is going on or how to debug it, as I'm new to OpenGL but everything looks correct in the source. I spitted geterrors all around the code but without any clue. I've attached my project if you want to take a look. You will need Visual Studio + vsandroid to compile.
apparently the problem is not on the sprite batch, but in the java code. I replaced for another one that uses surface view and no longer im getting this esotheric behavior.

image won't show in tableView

I'm creating a tableView in appcelerator (Android) and I want to add an image to it. This is just a test because I also had some problems with it in my project and I wanted to try it out first somewhere else so I wouldn't ruin my whole project.
I first added the standard png's to see if he would show those, and he did. But when I add a png that I've created, he refuses to show it in the tableView. Does someone know why he refuses to show the image? (I created that png in photoshop by changing one of the standard png's and adding my image to it.)
var win = Titanium.UI.createWindow({
title:'tableViewRow',
backgroundColor:'#fff'
});
var regData = [
{leftImage:'KS_nav_ui.png', title:'gft', left:20, color:'black'},
{rightImage:'KS_nav_views.png', title:'grofvuil', left:20, color:'black'},
{leftImage:'glas.png', title:'glas', left:20, color:'black'}
];
var tbl = Titanium.UI.createTableView({
data:regData
});
win.add(tbl);
win.open();
Here's an image of the result I get in my android emulator (android api: Google APIs Android 2.2 and screen:HVGA)
If you are using AppC 1.8, you may just need a forward slash in your path '/'. (or backward if Windows)
I've solved it. What I did is I ran the application in an android amulator. I closed the app and went back to the homescreen (where you can save some apps). I pressed on menu and went to the settings. Than I went to applications. I opened 'manage applications' and remove the application. I closed the emulator and ran it again and the images were shown.
I don't know why you have to do it, but it worked for me. I hope I can save someone the frustration by posting the answer (I know I had them :D)

Categories

Resources