I'm trying to plot map markers on a custom svg map that I generated with the online tool provided (https://highcharts.github.io/map-from-svg/). I'm trying to plot markers on a building interior by lat/long coordinate. Ultimately I want to create something like the marker cluster demo (https://www.highcharts.com/demo/maps/marker-clusters) with my custom SVG map.
My questions are:
Is it possible to plot markers on a custom SVG map by lat/long?
If so, how do I go about doing this? Do I geolocate the corners of the map to plot the markers by lat/long, or do I convert the marker locations to x/y on the map?
If I geolocate the custom SVG map, where do I add this data in the object?
If I convert the lat/long to x/y on the map, how do I go about this?
I have managed to convert my SVG into map Data using the online tool. I've searched through the docs, but I'm not putting the pieces together on how to do this.
Edit: I should mention that I'm using highcharts-angular (https://github.com/highcharts/highcharts-angular)
If you want to use cluster map should be prepare map to have a reference to the coordinate system, the generated SVG map is drawn without this.
This article describes how to create your own map with a datum, you need to generate the map as GeoJSON/TopoJSON and then you can reference lat/lon.
https://www.highcharts.com/docs/maps/custom-geojson-maps
In this example you can see how to load SVG map with Highmaps in Angular.
Related
I have a PDF map. What's the easiest way, to add a GPS "blue dot" with my location. Somehow to sync it with maps & add this PDF as a layer on top of that? Thanks
Here's a post on rendering a PDF to PNG. How to convert PDF to PNG efficiently?
You'll need to know the GPS coordinates at the top left and bottom right of the image that produces.
You can try creating an MKOverlay containing the image and define its MKMapRect based on those known coordinates.
If that doesn't work for some reason, you could use MKMapView's convert(_:toPointTo:) to tell you where those GPS coordinates are on a UIView that you manage yourself. (Heads up: that's more complicated than it seems)
I have an .mbtiles file and I am using it for offline map (iOS MapBox SDK). But my .mbtiles doesn't have enough data (just simple green rectangle). I want to draw some lines(roads) between points (I download it from my rest API). I found the solution to use RMShape, but I want to use already drawn map. I create my .mbtiles from osm and TileMill. Help me out please.
WhirlyGlobe-Maply SDK can help you achieve this.
It has a mapview and a globe view which you implement on your viewcontroller.
Then you create a layer using your mbtile file as shown below:
let tileSource = MaplyMBTileSource(mbTiles: "your-mbtile-filename")
You add this layer on the globe or map to display the tiles.
And using SDK's function like addShapes(), you can add, circles, vectors, labels, text and icons on the map/globe.
I tried adding lat and long lines programatically. Also tried adding some labels and spheres.
This is how it looks ->
WhirlyGlobe-Maply using mbtile and drawing on top of it
I need to show an indoor floor plan in a MKMapView. So far I have managed to load custom map tiles into MKMapView. But when I try to show annotations it does not show in correct location. The space between latitudes are not equal. I think it’s because MKMapView maps the globe into flat surface. But in my case I need to show annotations in a flat surface. Any idea how to do this?
EDIT : Anyone know how to convert geographic coordinates to cartesian coordinates? That will solve this problem
Apple just updated its demo project:
https://developer.apple.com/library/prerelease/ios/samplecode/footprint/Introduction/Intro.html
Take a look, there are information about how to translate geolocation (spherical) to flat location.
I implement MKMapView in my application to draw a path between two place,i found all lat long between two point using google map API but it shows the path through road.
My problem is that i want to show the path in building,
For example:
I want to draw path between the gate1 to gate 2 of Building, i pass the "to and from" lat-long in to the google MAP API, it shows the path through road so it shows the wrong distance.
I tried the indoor map also but it works only in register buildings.
I'd like to draw a grid into my map, that represents the size of a tile at a certain zoom level. So for example I'd like to have a grid on my mapview that shows the outline of a zoom level 10 tile. So the outline of where this tile would be. No matter if the mapview itself is at zoom level 5 or 15, it should display the outline of where that tile would be placed.
The problem I have is how to calculate the proper rect that represents each visible "tile".
Any help is sooo much appreciated!!!
Or maybe the answer to following question would help:
How can I convert a MKMapRect to a MKTileOverlayPath?
I find that MapKit is way too limited when you want to start doing more and more with maps.
I would reccomend using Google Maps SDK for iOS: https://developers.google.com/maps/documentation/ios/start
and then using GMSTileLayer for the tiles:
https://developers.google.com/maps/documentation/ios/reference/interface_g_m_s_tile_layer
In the long run, replacing MapKit with Google maps gives you far more features and options and has better geolocation and reverse geolocation than Apple
You can also look at Mapbox. Between using TileMill to create a grid layer by setting the Map background to a pattern image, you could then only export zoom level 10 and either host it on Mapbox or export it to MBTiles format (SQLite-based). Then one of the Mapbox mobile toolkits could serve the tiles out as an overlay on your map.