Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 14:04
    pauldendulk commented #1294
  • 14:04
    pauldendulk commented #1294
  • 14:04

    pauldendulk on master

    Moving namespaces Merge pull request #1296 from M… (compare)

  • 14:04

    pauldendulk on master

    Moving namespaces Merge pull request #1296 from M… (compare)

  • 14:04
    pauldendulk closed #1296
  • 14:04
    pauldendulk closed #1296
  • 14:04
    pauldendulk opened #1296
  • 14:04
    pauldendulk opened #1296
  • 14:03
    pauldendulk commented #1285
  • 14:03
    pauldendulk commented #1285
  • 13:58

    pauldendulk on moving-namespaces

    Moving namespaces (compare)

  • 13:58

    pauldendulk on moving-namespaces

    Moving namespaces (compare)

  • 13:43

    pauldendulk on master

    Fix build (compare)

  • 13:43

    pauldendulk on master

    Fix build (compare)

  • 12:04

    pauldendulk on master

    Remove unused method Merge Merge pull request #1295 from M… (compare)

  • 12:04

    pauldendulk on master

    Remove unused method Merge Merge pull request #1295 from M… (compare)

  • 12:04
    pauldendulk closed #1295
  • 12:04
    pauldendulk closed #1295
  • 12:03
    pauldendulk synchronize #1295
  • 12:03
    pauldendulk synchronize #1295
Paul den Dulk
@pauldendulk
You have to keep in mind that the numbers could not be whole numbers. Like 1:2343. or 1.343:50000
Ondra Svoboda
@ondrasvoboda
@pauldendulk I'd like to have bar and below the scale number like 1:1234.
Tony Fonager
@tonyfonager
Hi, hope everyone is doing okay.
I was wondering, is it possible to save a current map as PNG ? Like a screenshot thing. I need to preview my routes, and instead of creating MapsUI instances for each screenshot, I would love to just show a PNG
Paul den Dulk
@pauldendulk
It is possible but have to do some work yourself. There is the IMapControl.GetSnapshot() and IMapView.GetSnapshot(). It return a byte array which is encoded as png (that is what SKData.Encode() does). If you write this byte array to disk and give the file name a .png extension this should just work.
Tony Fonager
@tonyfonager
Thanks alot, Paul. I will try that 👍
Tony Fonager
@tonyfonager
It works. But I more want to use it for producing a “thumb” of a walked route, instead of a screenshot the current MapsUI component.
Is it fx possible to use the MapsUI engine for producing a screenshot - without the MapsUI being visible ?
Paul den Dulk
@pauldendulk
Yes, that should be possible. What could complicate it is that most Mapsui layers work asynchronous. So if you would write a command line tool with the same layers as in your app it would not have any data available in the layers unless you do a refresh and wait for it to load. Perhaps you could use the Busy attribute of the layer, although not sure if this is implemented correctly for all layers.
Tony Fonager
@tonyfonager
I can see how a command line too can do the job, but I was more thinking of doing it ON the users device. When they have tracked a 15 km walk, and later want to review/see it again, it could be cool to show an image with a thumbnail of the route
So I was more thinking, if I could create a MapsUI view, maybe hidden or 1x1 pixel, load the layers and then save the image.
Isnt the "screenshot" always the same size as the control ?
And how would it react if the control was disabled/hidden - you think that could work ?
Paul den Dulk
@pauldendulk
The screenshot functionality is built on top of other methods. Look at how it is implemented. You can use IRenderer.RenderToBitmapStream. It takes a viewport, you can initialize the viewport in your custom code with a custom width and height.
Tony Fonager
@tonyfonager
Sweet. I will take a look at it. And thanks 👍
Ondra Svoboda
@ondrasvoboda
Hi, I have a requirement to display in Mapsui raster data in MrSID, JFIF and maybe some other formats. Do you have some experience with that? Is there something I could use to start in Mapsui or any other library? Any advice is welcomed, thanks.
Paul den Dulk
@pauldendulk
There is no specific support for this. You would need to implement you own raster provider for that using a library that reads MrSID and JFIF.
StefanvdH67
@StefanvdH67

Hi,
I am trying out MapsUI in C# WPF, which works very nicely.
First try-outs have run fine, now I am an the way to do a bit more complex stuff.
What I am now struggeling is the way to declare way the map in XAML.
In the standard example it works fine:

<Window x:Class="Map01.MapsUITestWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Map01"
        xmlns:mapsuins="clr-namespace:Mapsui.UI.Wpf;assembly=Mapsui.UI.Wpf"
        mc:Ignorable="d"
        Title="MapsUITestWindow" Height="450" Width="800">
    <Grid>
            <mapsuins:MapControl Name="TestMap" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"></mapsuins:MapControl>
    </Grid>
</Window>

But, if I move the Map below a Stack Panel, the map is not visible anymore.

<Window x:Class="Map01.MapsUITestWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Map01"
        xmlns:mapsuins="clr-namespace:Mapsui.UI.Wpf;assembly=Mapsui.UI.Wpf"
        mc:Ignorable="d"
        Title="MapsUITestWindow" Height="450" Width="800">
    <Grid>
        <StackPanel Orientation="Vertical">
            <Label Content="Some Text"></Label>
            <mapsuins:MapControl Name="TestMap" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"></mapsuins:MapControl>
        </StackPanel>
    </Grid>
</Window>

==> Any idea, what I could do?

StefanvdH67
@StefanvdH67
I have found out by myself, if I use as frame a DockPanel (not StackPanel), the map is visible.
Works for me ok.
Nevertheless, do you have any explanation?
Petr Heinz
@hajmajeboss
Hello, is it possible to use custom renderers for rasterized layers?
The Draw() method of my custom renderer is not called
Yuliy Bugarinov
@bugarinov

I have found out by myself, if I use as frame a DockPanel (not StackPanel), the map is visible.
Works for me ok.
Nevertheless, do you have any explanation?

StackPanel does not vertically stretch the content unlike DockPanel.

StefanvdH67
@StefanvdH67
Ahh, thats reasonable - many thanks.
StefanvdH67
@StefanvdH67

Maybe, I can also get a hint for the following problem, I am struggeling with:
I have a map, which I navigate to a Point using this

Mapsui.Geometries.Point point = new Mapsui.Geometries.Point(lon,lat);
            var sphericalMercatorCoordinate = SphericalMercator.FromLonLat(point.X, point.Y);
            map.Home = n => n.NavigateTo(sphericalMercatorCoordinate, map.Resolutions[15]);

or using a Bounding Box, like this

 BoundingBox box = new BoundingBox(topleftpoint, bottomrightaspoint);
            map.Home = n => n.NavigateTo(box);

==> this works fine!
My problem now is, that I want to set the navigation to another Point/another Box.
But, simply just calling

map.Home = n => n.NavigateTo(...

again, does not change the map.
I found also something like

myMapControl.Refresh()

--> again, no change.

==> Any idea, please?

Yuliy Bugarinov
@bugarinov
Try the MapControl.ZoomToBox() function.
StefanvdH67
@StefanvdH67
Yeahh!, Many thanks, works fine!
Matt Emson
@memsom

Hey guys - first off, love Mapsui. I am going to be using it on a Xamarin Forms project.

I want to change some of the way the MapView works. But I'm struggling to do so because it has a lot of private/internal classes and methods. Any thoughts on creating a IMapView interface and using that instead? I've had a complete copy of the MapView working in my own fork, and by creating the IMapView interface I can make all of the dependencies happy. We really want to derive from MapView and add in a whole load of bespoke persistent MemoryLayers for different data sources we feed in in real time. I have it working, but would you guys accept a merge request where I give you a "BaseMapView" and a IMapView and then everything is implemented on top of those classes? It would make customising the controls a lot easier.

Secondly, what are the current plans for Vector rendering? We could really do with MBTiles vector support. I will attempt to look at it (I got as far as unpacking the data from a vector MBTiles file and so I just need to process the GeoJSON and make the render happen... but that is something I won't get a chance to really look at this year.)

Matt Emson
@memsom

I implemented arbitrary layers with zorder today also, so you can add a new layer based on a type some type of feature and can then set the zorder of the layers so that the layer is not on top of other existing layers. I have to be honest, I've had to redo quire a lot of the protection level of some things and add in a bunch of interfaces and abstraction to make it work. It's not in a github repo at the moment, but I'll try to see what I can add in to my fork on Github.

Do we see this project as strongly active? I don't want to go off on a wild tangent if people are working on stuff. But I need the changes I made for the app, so I wanted to get feedback first.

Matt Emson
@memsom
Hey guys, I've noticed that a pin rendered at a specific position has it's bottom most point about 50% lower than an SVG rendered at the same position. I assume the pin's location is the bottom most point? So, and SVG should be rendered with the pin stabbing its mid point. Any ideas as to why the Pin and SVG are so far off centre?
Matt Emson
@memsom
Figured it out - the Point set in the defaults for the Y of Anchor are offset from 0.
Matt Emson
@memsom
Merged my changes - they are based on my private fork. I added a demo of the Marker concept. You are welcome to use my code, but I don't expect it to necessarily fit your needs. I'll carry on merging my changes in to my fork. If it gets to the point that things get massively off your codebase, I'll consider renaming it to disambiguate.
Tomek Lorek
@eltomek
Hi there, not sure if this is the right place for support requests, I'm trying to figure out the difference between MapControl and MapView and their relation to each other. Noticed that the quickstart for Xamarin.Forms (http://mapsui.com/documentation/getting-started-xamarin-forms.html) suggests using MapView while the one for Android to use MapControl. Also noticed that MapView comes with zooming, northing and current location buttons and MapControl does not. Both share some methods and properties. Not sure what key to use either of them is, could you please help?
Davis Millier
@DavisMillier
Hello , I want to have offline desktop application for map navigation, I was download OSM world map and uploaded to Postgis database with OsmTopgsl , Now i want to have fast rendering library like Mapnik/MapBox and other the same(something like OpenStreetMap site but in local and offline mode) . I want to know how to act? And what libraries are available for .NET language and Qt framework?
Tomek Lorek
@eltomek
Can I somehow make Callout object react on TouchStart/TouchEnd/TouchMove events? I'd like to make a feature that the user creates a route on the map by tapping onto a map and each map touch creates a new node represented by a dot/circle (a Callout maybe?) that connects with a line with a previous one. That's pretty simple to do but I want the user to be able to move the existing node by simply touching and dragging it. While he drags the node, I need the line connection to be re-drawn. I don't really know where to start with because I can see none of the objects that I could use as a visual representation for a node support OnTouch/OnPress/OnRelease events. Only MapView and MapControl seem to support them but is there any way to identify a Callout that has been clicked? I'll appreciate your help.
Matt Emson
@memsom

@eltomek the MapView is a Xamarin forms control. It wraps the MapControl iirc.

I think youd use a Pin to represent the points. The Callout is attached usually to another map object. The callout is more like a label in my opinion.

I’ve done quite a bit of playing with the internals, and you can add your own layer an implement your own objects too. Pin is simple enough to use, but bloated in features.

@DavisMillier you can use offline raster maps in mbtile format easily enough. There is currenty no vector support. I dont think you will find exactly what you describe, but you could implement it yourself.
Dino N
@dinonovak
I would like to use offline map. I have downloaded country map from https://data.maptiler.com/downloads/tileset/osm/europe/, format is specified as MBtiles (PBF), how can i add this as map layer?
I found the sample how to do it with raster MBtiles and for world.map that I cound in samples it works
Mühlbacher Herbert
@M1060Herbert_twitter
I am trying to load an historical map in PNG format into a geometry polygon; the map corners exist in geo points. When the map is fixed as a geo point (center point), the map becomes instable, meaning that the map is repeatedly masked out. The map can be loaded into a polygon with 4 corners, but there is no link to points and there is no scale. I have been trying to solve this problem for 2 months. Can anyone help me?
Paul den Dulk
@pauldendulk
@M1060Herbert_twitter There is also the Raster. In Mapsui this is a Geometry type (which is weird, I admit). Tiles are loaded as such. I don't understand what you mean with 'link to points and there is not scale'.
Martin Slater
@martin-slater
Hey there. I am just testing out Mapsui to replace an older maps solution. I am using Mapsui.UI.Forms version v3.0.0-alpha.4. There is some code that changes the map pins based on zoom level that is below. This runs very slowly causing lengthy hitches when the markers change for even small numbers of pins (10 or so). Am I doing something dumb? cheers.
                var zoomLevel = (int)Mapsui.UI.Forms.Extensions.ZoomLevelExtensions.ToZoomLevel(searchMap.Viewport.Resolution);

                if (zoomLevel != viewModel.CurrentZoomLevel)
                {
                    viewModel.CurrentZoomLevel = zoomLevel;
                    viewModel.SetMarkersForZoomLevel(viewModel.CurrentZoomLevel);
                    searchMap.Pins.Clear();                        
                    foreach (var marker in viewModel.PinCollection)
                     {
                            var pin = new Mapsui.UI.Forms.Pin(searchMap);
                            pin.Label = marker.Label;
                            pin.Type = Mapsui.UI.Forms.PinType.Pin;
                            pin.Address = marker.Label;
                            pin.Position = new Mapsui.UI.Forms.Position(marker.Location.LatitudeDeg, marker.Location.LongitudeDeg);
                            pin.Color = new Xamarin.Forms.Color(rnd.Next(0, 256) / 256.0, rnd.Next(0, 256) / 256.0, rnd.Next(0, 256) / 256.0);

                            searchMap.Pins.Add(pin);
                    }
                }
Martin Slater
@martin-slater
FWIW this was caused by the pin loading code which continually hits the disk to reload the pin SVG and create the pin bitmap. Changing to use a feature layer and custom styles works fine for performance
Moustapha
@moustaphahadjis
Hello guys, how is it possible to add mapsui mapcontrol to avalonia gui?
Tony Fonager
@tonyfonager
Hi guys, long time since our last talk. My hiking app is nearing all features done, but I still have severe performance issues with MapsUI.
Just loading the map on a simple page, it is not responsive for the first 7-8 seconds and UI hangs
Dino N
@dinonovak
Is there a way to create a custom callout in xamarin forms. I need picture with text in callout, and callout to react on tap event by opening new page. any hints?
Akhil VS
@akhilvs000
Is there a way to get IEnumerable<List<Mapsui.UI.Forms.Polygon>> from boundingbox?
Johan Ferguson
@johanferguson
Hi Guys,
I am trying to create a labels using LabelStyle. The Font does not seem to respond to e.g. setting it to bold.
Am i missing something?
Kseudo
@Kseudo
Hi Guys,
Hi Guys, I am newbie developer. I want to use dark mode in Mapsui.How can I do? Any suggestion please.