As many currently know Googlemaps' Webapi do not work correctly on the webview because the latest versions use webgl

I decided to do a new library that uses OpenMap and Leaflet with the same methods and events of the Googlemaps bookshop. I also created a second OpenMapext class that adds some Googlemapsext commands to maintain compatibility and minimize changes to the existing code. The code we used with GMAPS with Javaobject to obtain extra functions is no longer usable. Tested with Java 19,

jSD_OpenMaps

Author:
Star-Dust
Version: 1.10
  • CameraPosition
    • Functions:
      • Class_Globals As String
      • Initialize (Lat As Double, Lng As Double, Zoom As Float) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • Target As String
      • ToString As String
    • Properties:
      • Lat As Double [read only]
      • Lng As Double [read only]
      • Zoom As Float [read only]
  • LatLng
    • Fields:
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • Latitude As Double
      • Longitude As Double
    • Functions:
      • Initialize
        Inizializza i campi al loro valore predefinito.
  • MapCircle
    • Functions:
      • Class_Globals As String
      • Initialize (vCenter As LatLng, vRadius As Double, Visble As Boolean, id As String, WebView As JavaObject) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
    • Properties:
      • Center As LatLng [read only]
      • ID As String [read only]
      • Radius As Double [read only]
      • Visible As Boolean
  • MapInfoWindow
    • Functions:
      • Class_Globals As String
      • Initialize (vContent As String, vPosition As LatLng, ID As String) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
    • Properties:
      • Content As String [read only]
      • ID As String [read only]
      • Position As LatLng [read only]
  • MapLabel
    • Functions:
      • Class_Globals As String
      • Initialize (vPosition As LatLng, vText As String, vPermanent As Boolean, vID As String, WebView As JavaObject) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
    • Properties:
      • ID As String [read only]
      • Permanent As Boolean [read only]
      • Position As LatLng [read only]
      • Text As String
  • MapPolygon
    • Functions:
      • Class_Globals As String
      • Initialize (Visble As Boolean, ID As String, Point As List, StrokeWidth As Int, StrokeColor As Paint, FillColor As Paint, Opacity As Double, WebView As JavaObject) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
    • Properties:
      • FillColor As Paint [read only]
      • ID As String [read only]
      • LineColor As Paint [read only]
      • LineWidth As Int [read only]
      • Opacity As Float [read only]
      • Points As List [read only]
        List of LatLng
      • Visible As Boolean
  • MapPolyline
    • Functions:
      • Class_Globals As String
      • Initialize (Visble As Boolean, ID As String, Point As List, StrokeWidth As Int, StrokeColor As Paint, WebView As JavaObject) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
    • Properties:
      • ID As String [read only]
      • LineColor As Paint [read only]
      • LineWidth As Int [read only]
      • Points As List [read only]
        List of LatLng
      • Visible As Boolean
  • Marker
    • Functions:
      • Class_Globals As String
      • CreateLabel (Text As String) As String
        Create Label on Marker
      • Initialize (vPosition As LatLng, vTitle As String, vIconUri As String, vVisible As Boolean, vID As String, WebView As JavaObject) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • UpdateLabel (Text As String) As String
        Set Text empty for remove
    • Properties:
      • Draggable
      • IconUri As String [read only]
      • IconUrl As String [read only]
      • ID As String [read only]
      • Position As LatLng [read only]
      • Title As String [read only]
      • Visible As Boolean
  • OpenMaps
    • Events:
      • CameraChange (CamPosition As CameraPosition)
      • CircleClick (SelectedCircle As MapCircle)
      • Click (Point As LatLng)
      • MarkerClick (SelectedMarker As Marker)
      • MouseMove (Point As LatLng)
      • PolygonClick (SelectedPolygon As MapPolygon)
      • PolylineClick (SelectedPolyline As MapPolyline)
      • Ready
      • RightClick (Point As LatLng)
    • Fields:
      • MAP_TYPE_CARTO As Int
      • MAP_TYPE_ESI As Int
      • MAP_TYPE_HYBRID As Int
      • MAP_TYPE_NORMAL As Int
      • MAP_TYPE_SATELLITE As Int
      • MAP_TYPE_TERRAIN As Int
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • AddCircle (ll As LatLng, Radius As Double, StrokeWidth As Float, StrokeColor As Paint, FillColor As Paint, Opacity As Double) As MapCircle
        Adds a circle To the map.
        Center - Position of the circle center.
        Radius - Circle radius.
        StrokeWidth - Stroke width.
        StrokeColor - Stroke color.
        FillColor - Inner color.
        Opacity - Inner color opacity. Value between 0 To 1.
      • AddInfoWindow (Content As String, Position As LatLng) As MapInfoWindow
        Opens an info window with the given HTML content at the specified position.
      • AddInfoWindow2 (Content As String, Position As LatLng, MaxWidth As Int) As MapInfoWindow
        Opens an info window with the given HTML content at the specified position. It cannot be larger than MaxWidth (in pixels).
      • AddMarker (Lat As Double, Lng As Double, Title As String) As Marker
        Adds a marker to the map.
      • AddMarker2 (Lat As Double, Lng As Double, Title As String, IconUri As String) As Marker
        Adds a marker To the map with a custom icon.
        The IconUri must point To an online image Or an image from the assets folder.
        In the later Case the custom icon will only appear in Release mode.
        Example:
        <code>gmap.AddMarker2(10, 10, "This is a test", _
        File.GetUri(File.DirAssets, "SomeIcon.png"))</code>
      • AddPolygon (Points As List, StrokeWidth As Float, StrokeColor As Paint, FillColor As Paint, Opacity As Double) As MapPolygon
        Adds a polygon To the map.
        Points - A list Or Array of LatLng points.
        es. array(array(41.90, 12.49),array(41.80, 12.50),array(41.85, 12.60))
        StrokeWidth - Stroke width.
        StrokeColor - Stroke color.
        FillColor - Inner color.
        Opacity - Inner color opacity. Value between 0 To 1.
      • AddPolyline (Points As List, StrokeWidth As Float, StrokeColor As Paint) As MapPolyline
        Adds a polyline To the map.
        Points - A list Or Array of LatLng points.
        Width - Line width.
        Color - Line color.
        CloseInfoWindow (InfoWindow As InfoWindow)
        Closes the specified info window.
      • AllVisibleMapObjects As String
      • CameraPosition As CameraPosition
        Returns the current camera position.
      • Class_Globals As String
      • ClearMap As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • EditConfigure (Offset As Double, Tollerance As Int) As String
        Offset -> Map difference; Tollerance -> Editing Poly point
      • EditingActive As Boolean
      • EditingCircle (Circle As MapCircle, Active As Boolean) As Boolean
      • EditingPolygon (Polygon As MapPolygon, Active As Boolean) As Boolean
        If an element is already in editing, it is not possible to edit another at the same time.
        Dim Success As Boolean = OpenMap.EditingPolygon(Polygon,True)
      • EditingPolyline (Polyline As MapPolyline, Active As Boolean) As Boolean
      • filterVisibleMapObjects As String
        Makes only the objects visible inside the visible map (Bounds)
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • IsReady As Boolean
      • LatLonToXY (ll As LatLng) As Double()
      • LoadMKL (Path As String, FileName As String) As Map
        Return Map as Object
        Key is ID , Value is Object (Marker,MapPolygon,MapPolyline)
        <code>ObjectMap = OpenMap.LoadMKL(Path, FileName)</code>
      • MapLoaded As Boolean
      • MessageToPanel (Text As String) As String
      • MoveCamera (cp As CameraPosition) As String
      • MoveCamera2 (ll As LatLng) As String
      • PanelOff As String
      • PanelOn As String
      • RedrawAllObj As String
      • RemoveCircle (vCircle As MapCircle) As String
        Removes the specified circle from the map.
      • RemoveInfoWindow (InfoWindow As MapInfoWindow) As String
      • RemoveMarker (vMarker As Marker) As String
        Removes the specified marker from the map.
      • RemovePolygon (vPolygon As MapPolygon) As String
        Removes the specified polygon from the map.
      • RemovePolyline (vPolyline As MapPolyline) As String
        Removes the specified polyline from the map.
      • SaveKML (MapObj As Map, Path As String, FileName As String) As String
      • UpdateCircleRadius (id As String, Radius As Double) As String
        NewPoint as List of LatLng
      • UpdatePolygon (Plg As MapPolygon, NewPoints As List) As String
      • UpdatePolyline (Pll As MapPolyline, NewPoints As List) As String
      • visibleObject (ID As String, Visible As Boolean) As String
        es. OpenMap.visibleObject(Polygon.ID)
      • ww As JavaObject
      • XYToLatLng (x As Double, y As Double) As LatLng
    • Properties:
      • MapBound As Map [read only]
        Return bound in map format:
        {"northEast":{"lat":45.123,"lon":12.456},"southWest":{"lat":40.987,"lon":10.321}}
        Dim Bound As Map = OMaps.MapBound
      • MapType
        get or set the zoom level.
      • NumberOfElements As Int [read only]
        Number Of Elements added
      • Zoom As Int
        Sets the zoom level.
  • OpenMapsExt
    • Functions:
      • AddressToLatLon (address As String) As ResumableSub
        <code>wait for (GMapExt.AddressToLatLon("Address number, City")) COMPLETE (ll as LatLng)</code>
      • Class_Globals As String
      • GetBearing (Point1 As LatLng, Point2 As LatLng) As Double
        Returns the bearing between two points, from point1 to point2- not exist
      • GetCircleIsDraggable (Cricle As MapCircle) As Boolean
      • GetDistance (Point1 As LatLng, Point2 As LatLng) As Double
        Returns the distance between two points in meters
      • GetMarkerIsDraggable (Mk As Marker) As Boolean
      • GetMarkerLabel (m As Marker) As String
        not available
      • GetMarkerPosition (m As Marker) As LatLng
        Returns the marker position as LatLng Object
      • GetMarkerTitle (m As Marker) As String
        Returns the title of a marker as string
      • GetPolygonIsDraggable (Polygon As MapPolygon) As Boolean
      • GetPolylineIsDraggable (Polyline As MapPolyline) As Boolean
      • Initialize (OpenMap As OpenMaps) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • LatLonToAddress (lat As Double, lon As Double) As ResumableSub
      • LatLonToXY (ll As LatLng) As Double()
        Returns the screen coordiantes for the given LatLng coordinates
      • LatLonToXY2 (ll As LatLng) As Double()
      • RemoveMarkerLabel (m As Marker) As String
        not available
        Removes the Marker Label for the given Marker
      • SetCircleDraggable (C As MapCircle, Draggable As Boolean) As String
        Sets the circle draggable property
      • SetGeodesic (shape As JavaObject) As String
        Sets a polygon or polyline to geodesic points - not exist
      • SetMarkerClickable (m As Marker, Clickable As Boolean) As String
        Always clickable - not necessary
        Sets the marker clickable property
      • SetMarkerDraggable (m As Marker, Draggable As Boolean) As String
        Sets the marker draggable property
      • SetMarkerIcon (m As Marker, URL As String) As String
        not available
      • SetMarkerLabel (m As Marker, Text As String, Color As String, TextSize As Double) As String
        not available
        Sets a MarkerLabel with the given values.
        Posible color values.
      • SetMarkerLabel2 (m As Marker, Text As String, Color As String, BackgroundColor As String, TextSize As Double) As String
        not available
      • SetMarkerOrigin (m As Marker, X As Double, y As Double) As String
        not available
        Sets the marker origin 'doesn't work!!!
      • SetPolygonClickable (pg As MapPolygon, Clickable As Boolean) As String
        Always clickable - not necessary
        Sets the polygon clickable property 'doesn't work!!!
      • SetPolygonDraggable (Polygon As MapPolygon, Draggable As Boolean) As String
        Sets the polygon draggable property
      • SetPolylineDraggable (Polyline As MapPolyline, Draggable As Boolean) As String
        Sets the polyline draggable property
      • XYToLatLng (x As Double, y As Double) As LatLng
        Returns the Lat/Lng coordinates for the given screen coordinates 'doesn't work!!!


  • 1.01
    • Added on OpenMapsExt: SetCircleDraggable, SetPolygonDraggable, SetPolylineDraggable
  • 1.02
    • Coordinated renewal after movement for circle, polygon and polyline
    • Update example
  • 1.03
    • Removal of lateral sliding bars
    • Additions EditingPolygon and EdgingPolyline Method to change the points
    • Added VisibleObject method to view or hide an object (markatore, circle, polygon, polyline)
    • Add the PanelOn and PanelOff functions to make a communication panel appear or hide
    • Added MessageToPanel method to send messages to the communication panel
  • 1.04
    • Fix bugs
    • Added method GetMarkerIsDraggable, GetCircleIsDraggable, GetPolygonIsDraggable, GetPolylineIsDraggable
    • Added method: EditingPolyline, EditingPolygon and function EditingActive
  • 1.05
    • Fix Bugs and update Demo
  • 1.06
    • Added method: RedrawAllObj, ClearMap, EditingCircle, updateCircleRadius
    • Added new TypeMap: MAP_TYPE_ESI, MAP_TYPE_CARTO - As an alternative to OSM tiles if they don't appear
  • 1.07
    • Added method: LoadKML, SaveKML
    • Removed Hyperlinks, Preserved Maps Elements after change Map_Type
    • Fix bugs
    • The algorithm reconstructed for the modification of the polygons, polylines and rims
  • 1.08
    • Added getMapBound, filterVisibleMapObjects, AllVisibleMapObjects, NumberOfElements
    • Added Label on Marker
  • 1.09
    • Fix bugs for LoadKML, AddMarker, AddCircle, AddPolygon, AddPolyline
    • Correct LatLng class field (Lat to Latitude, Lng to Longitude)
    • Update Sample
  • 1.10
    • Added method UpdatePolyline, UpdatePolygon
    • Update class Polyline, Polygon
    • Fix bugs
  • 1.11
    • Added method InsidePath, UpdateCircleCenter, UpdateMarkerPosition, ObjectIsEditing
    • Correct LatLng class method Initialize(Lat,Lng)
 

Attachments

  • jSD_OpenMaps 1.10.zip
    56.9 KB · Views: 13
Last edited:

javiers

Active Member
Licensed User
Longtime User
Yes it is a bug, known.

When you insert the Markers you must put a pause of at least 20 milliseconds between one and the other especially when it is inside a cycle so that in its internal table all the marks are inserted correctly. subsequently the deletion will happen as expected.

The bug will be solved in the next versions
Thanks for the quick response!!!

I've changed the image associated with the marker to 512x512 pixels and it looks good now. I understand this is the size marker images should be, right?
 

Star-Dust

Expert
Licensed User
Longtime User
Thanks for the quick response!!!

I've changed the image associated with the marker to 512x512 pixels and it looks good now. I understand this is the size marker images should be, right?
Yes
 

Star-Dust

Expert
Licensed User
Longtime User
Release 1.09
  • Fix bugs for LoadKML, AddMarker, AddCircle, AddPolygon, AddPolyline
  • Correct LatLng class field (Lat to Latitude, Lng to Longitude)
  • Update Sample


P.S. I started the adaptation for B4A and B4i but the management of JS is asynchronous compared to the synchronous of B4J. So you have to make several changes. It will spend some time before seeing the multi-platform version
 

Star-Dust

Expert
Licensed User
Longtime User
Hi, I can't remove some markers from the map. For example, I create them like this...


Create markers...:
Sub CargaHidrantes
    Private MiHidrante(10)  As Marker
 
    MiHidrante(0) = OMaps.AddMarker2(pt(48.8575703, 2.292737).lat, pt(48.8575703, 2.292737).lng, "Hidrante" , File.GetUri(File.DirAssets,"H.png"))
    MiHidrante(1) = OMaps.AddMarker2(pt(48.8561703, 2.293637).lat, pt(48.8561703, 2.293637).lng, "Hidrante" , File.GetUri(File.DirAssets,"H.png"))
    MiHidrante(3) = OMaps.AddMarker2(pt(48.8561703, 2.291837).lat,pt(48.8561703, 2.291837).lng, "Hidrante" , File.GetUri(File.DirAssets,"H.png"))


End Sub

When I change the camera position and the zoom is less than 14, I use the following code to delete them... but it doesn't!

B4X:
Private Sub OMaps_CameraChange (CamPosition As CameraPosition)
    LabelLat.Text=CamPosition.lat
    LabelLon.Text=CamPosition.lNG
    LabelZoom.Text=CamPosition.Zoom
 
    If OMaps.Zoom < 14 Then
        For i=0 To 3

            If MiHidrante(i).IsInitialized = True Then
                Log(i)
                OMaps.RemoveMarker(MiHidrante(i))
            End If
        Next
    End If
End Sub
With version 1.9 it is no longer necessary to insert a pause (Sleep) after inserting an object

Hi, I don't know if this is interesting to you or if it's part of your plans...

In an app, I create many markers (hydrants), but to avoid overloading the map, depending on the zoom, I only make visible those within the visible map boundaries. For this, I need the Bounds function, and I also need the marker's visible property to not be read-only.

I'm not sure if I'm explaining myself correctly. I'll include an image and part of the code...

Visible map boundaries...:
'''    If GMap.IsReady = True Then
'''        LatLngB = GMap.Bounds    'Visible region bounds
'''        Log( "Norte " & LatLngB.NorthEast & " SUR   " & LatLngB.SouthWest)
'''        Dim DeltaX As Double = LatLngB.NorthEast.Lat - LatLngB.SouthWest.Lat
'''        Dim DeltaY As Double = LatLngB.NorthEast.Longitude - LatLngB.SouthWest.Longitude
'''    End If
'''
'''    If newzoom <= 14 Then 'Con un zoom lejano, oculta todos los marcadores
'''        Dim cursorHidra As ResultSet
''''        cursorHidra = SQL1.ExecQuery("SELECT rowid,idMarcador, identificador FROM markerHidra WHERE idMarcador <> 0")
''''        cursorHidra = SQL1.ExecQuery("SELECT rowid FROM hidrantes ")
'''        cursorHidra = SQL1.ExecQuery("SELECT rowid FROM hidrantes")
'''        Do While cursorHidra.NextRow
'''            If MiHidrante(cursorHidra.GetString("rowid")).IsInitialized = True Then
'''                MiHidrante(cursorHidra.GetString("rowid")).Visible = False
'''            End If
'''        Loop
'''        cursorHidra.Close
'''    End If
'''
'''
'''    If newzoom > 14 Then
'''        Dim cursorHidra As ResultSet
''''        (Y - " & LatLngB.SouthWest.Lat &") < "& DeltaX &" AND  (X - "& LatLngB.SouthWest.Longitude &")  <"& DeltaY &")"
''''        cursor = SQL1.ExecQuery("SELECT rowid,ID, X, Y, TIPO, POBLACION FROM hidrantes WHERE (Y - " & LatLngB.SouthWest.Lat &") < "& DeltaX &" AND  (X - ("& LatLngB.SouthWest.Longitude &"))  <"& DeltaY &"")
'''        cursorHidra = SQL1.ExecQuery("SELECT rowid FROM hidrantes WHERE (Y - " & LatLngB.SouthWest.Latitude &") < "& DeltaX &" AND  (X - ("& LatLngB.SouthWest.Longitude &"))  <"& DeltaY)
'''
'''        Do While cursorHidra.NextRow
'''            If MiHidrante(cursorHidra.GetString("rowid")).IsInitialized = True Then
'''                MiHidrante(cursorHidra.GetString("rowid")).Visible = True
'''            End If
'''        Loop
'''        cursorHidra.Close
'''    End If

Sorry, the markers are displayed too large...the image I'm using in this case is a 16x16 pixel PNG file. I've tried changing it to 8x8, but the result is the same...

View attachment 162633
With Filtervisiblemapobjects only visible objects visible at the time inside the boud. If the room changes it must be recalled again.
With Allvisiblemapobjects all objects will be loaded on the map even if you win from visibility
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Would love to see the capability to add a label to a marker by implementing SetMarkerLabel, RemoveMarkerLabel, GetMarkerLabel in OpenMapsExt

In leaflet you could use L.tooltip to create a standalone label instead of binding it to a marker. That would be the same as adding a label to a marker that is always visible:

B4X:
var tooltip = L.tooltip()
    .setLatLng(latlng)
    .setContent('A sweet static label!')
    .addTo(map);


View attachment 162635
Inside the marker, you now have new methods to create a label and modify it. If when you modify it, put an empty text the label will be removed
 

javiers

Active Member
Licensed User
Longtime User
Hi, sorry to continue with the marker images. Since they're square (512x512), images with a different aspect ratio (e.g., rectangular) appear very distorted. And if you change the original image to 512x512, the marker becomes very small...
It's not significant, but in my case, some icons don't display visually correctly

The important thing is that the map library works very well. And thanks again for all the work you're doing!
 

Attachments

  • icons.jpg
    icons.jpg
    40.8 KB · Views: 23

Star-Dust

Expert
Licensed User
Longtime User
Hi, sorry to continue with the marker images. Since they're square (512x512), images with a different aspect ratio (e.g., rectangular) appear very distorted. And if you change the original image to 512x512, the marker becomes very small...
It's not significant, but in my case, some icons don't display visually correctly

The important thing is that the map library works very well. And thanks again for all the work you're doing!
I can't tell you because you have this problem. It is certainly linked to Leatlef. Sometimes I do not appear to me for some reason, restart the application and works properly.
If I understand the reason I will look for a solution.
 

emexes

Expert
Licensed User
Since they're square (512x512), images with a different aspect ratio (e.g., rectangular) appear very distorted.

I don't understand this. Don't you just fit the image to your square, applying the same scale in both x and y directions?

eg if your rectangle was 3 times as wide as it is high, then you would scale it to be 512 pixels wide and (512 / 3) = 171 pixels high, and then vertically center that within the square target ie 171 down from the top of the square.

or to use what I think is your example of a problem:

start with your rectangular 71x29 marker (which I found to be either 70x28 without the black border or 72x30 with the black border, so I went with the one including the black border to make it easier to see what's happening) :

1742696094991.png


and scale that to be 512 pixels wide (ie 512x213) :

1742696163509.png


and then center that within the 512x512 pixel marker size (here using cyan as transparent) :

1742696274624.png


Obviously that image would be a lot sharper if we started from a vector or larger image rather than the 71x29 image from your example.
 
Last edited:

emexes

Expert
Licensed User
I don't understand this. Don't you just fit the image to your square,

I'm making the bold assumption that the marker images can have an alpha channel or transparent color, and that the displayed marker is not necessarily a full 512x512 square.

Like with these blue drop markers, that are clearly not squarish:

1742696947518.png


and I've just noticed they have shadows (nice touch!) and thus must have an alpha (opaqueness) channel.
 

javiers

Active Member
Licensed User
Longtime User
I don't understand this. Don't you just fit the image to your square, applying the same scale in both x and y directions?

eg if your rectangle was 3 times as wide as it is high, then you would scale it to be 512 pixels wide and (512 / 3) = 171 pixels high, and then vertically center that within the square target ie 171 down from the top of the square.

or to use what I think is your example of a problem:

start with your rectangular 71x29 marker (which I found to be either 70x28 without the black border or 72x30 with the black border, so I went with the one including the black border to make it easier to see what's happening) :

View attachment 162842

and scale that to be 512 pixels wide (ie 512x213) :

View attachment 162843

and then center that within the 512x512 pixel marker size (here using cyan as transparent) :

View attachment 162844

Obviously that image would be a lot sharper if we started from a vector or larger image rather than the 71x29 image from your example.


Yes, I'd already done the process you described to adapt the image to 512x512, but as I said, the marker image is visually small, as you can see in the image. Thanks for the replies anyway!
 

Attachments

  • icons.jpg
    icons.jpg
    43.3 KB · Views: 11

javiers

Active Member
Licensed User
Longtime User
I can't tell you because you have this problem. It is certainly linked to Leatlef. Sometimes I do not appear to me for some reason, restart the application and works properly.
If I understand the reason I will look for a solution.

Using Gemma3 (something I've never done before), he suggests this code to control the icon size... I have no idea if this can help or not. I certainly don't know how to do it!

I don't want to distract you any further with this issue. I'm sure that if there's a solution, you'll find it.

Congratulations again for this great work.

JavaScript:
var myIcon = L.icon({
    iconUrl: 'my-icon.png',
    iconSize: [32, 32], // Ancho y alto en píxeles
    iconAnchor: [16, 16], // Punto de anclaje del icono (opcional)
});

var marker = L.marker([lat, lng], {icon: myIcon}).addTo(map);
 

aminoacid

Active Member
Licensed User
Longtime User
Is it possible to display a ToolTip or InfoWindow when you hover over a Marker? This feature is available in GoogleMaps and Leaflet - Any possibility of adding it if it does not already exist (if so, I could not figure out how to do it). Thanks!

PS: The Library looks great so far. I have completely converted over my GoogleMaps application to OpenMaps and the process has been quite simple thanks to your ensuring compatibility.
 

Ralph Parkhurst

Member
Licensed User
Longtime User
Could I please add one more request?? Is it possible to add a method to edit a polygon's linecolor, linewidth and fillcolor? At the moment I do this by adding a new polygon with the required settings, and then remove the previous polygon. This gets hard to manage when you have a lot of polygons because the ID changes each time.

I agree with @aminoacid - I have now implemented jSD_OpenMaps into my app and found it very easy and straightforward to make the changes.
 

Star-Dust

Expert
Licensed User
Longtime User
I adapted an application based on the example of @klaus and written for jGoogleMap.
Of course there are still many differences and there are different methods, as I wrote before you have to be patient because I have returned to work and I can work there slowly.

I am aware of all that is missing, have patience

1743022936514.png
 
Last edited:
Top