afsuarez / mapsforge-cordova-plugin Goto Github PK
View Code? Open in Web Editor NEWPlugin for Apache Cordova (aka Phonegap) that wraps the mapsforge libraries. :warning:Discontinued:warning:
Plugin for Apache Cordova (aka Phonegap) that wraps the mapsforge libraries. :warning:Discontinued:warning:
Hello,
I try to use the plugin with the Ionic framework. When i run it in the android emulator with genymotion, i've always the same error message in the console : 'Map file not found'. Here is the code in the controller :
$ionicPlatform.ready(function() {
var mapfile = "/sdcard/Download/albania.map";
// initialize the map on the "map" div with a given center and zoom
var map = L.map('map', {
center: [41.328341,19.818761],
zoom: 9
});
mapsforge.cache.initialize(mapfile,
function() {
console.log("map file loaded");
L.offlineTileLayer({
maxZoom: 18,
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
},
function(error) {
console.log("error loading map file: " + mapfile);
console.dir("error:" + error);
});
}
I've uploaded the 'map into the download folder by dragging the file into the emulator, and i can see the file in the file manager of the emulator. I tested many different paths (for instance /storage/emulated/0/Download/albania.map, /sdcard/Download/albania.map, etc.), but the plugin never finds the map file . Also by default, the map is stored within my project in the www/data folder. So i tried also '/android_asset/www/data' or 'file:///android_asset/www/data' folders, but it's not working.
Do you have any idea how to specify the folder ?
ASAP, I will clean up the code and complete it with javadoc.
I will also complete the documentation of the javascript interface and provide some code examples with probably some screenshots.
I have maps of two countrys. If I load a map and move the map outside the country, white tiles are generated and cached.
Wenn I than change the country map, die tiles are still white, even if the data are present now.
Maybe a solution could be not to cache empty tiles. They are generated fast anyway.
Is there an other solution to use more than one map file?
Hello I am testing the cordova with the "Visual Studio" and I am unable to compile the project after adding the plugin mapsforge, despite the project newly created.
Can you help me identify the error
Severity Code Description Project File Line Error c:\users\NameUser\documents\visual studio 2015\Projects\Test\Test\platforms\android\assets\patterns"
not located within project! Test c:\users\NameUser\documents\visual studio 2015\Projects\Test\Test\MDAVSCLI 1
Version VS2015RC
https://www.visualstudio.com/en-us/features/cordova-vs.aspx
thanks for listening
Leaflet map is frozen while tiles are generated. No Pan, No Zoom until tiles are rendered.
I made a small example with online and offline map.
https://github.com/robotnic/mapsforge-cordova-plugin-example
Maybe you need it.
I install this plugin, but it does not work
I did:
cordova plugins add https://github.com/afsuarez/mapsforge-cordova-plugin.git
The lib exists
ls plugins/com.suarez.cordova.mapsforge/src/android/libs
mapsforge-core-0.4.0.jar mapsforge-map-0.4.0.jar mapsforge-map-android-0.4.0.jar mapsforge-map-reader-0.4.0.jar svg-android-0.4.0.jar
But in javascript there is no object "mapsforge"
Any idea what I do wrong?
I try to do Theming, but no success at the moment.
mapsforge.cache.setThemePath("Elevelo_Cycling.xml",function(){
console.log("theme ok");
},function(error){
console.log("theme error: "+error);
})
The file exists
find . -name Elevelo_Cycling.xml
./platforms/android/assets/renderthemes/Elevelo_Cycling.xml
The result is:
theme error: null
For mapsforge.embedded there is the method:
setOfflineTileLayer([String mapFilePath, String renderThemePath], {onSuccess, onError}*)
for setting the map theme.
Is this also possible with mapsforge.cache?
I want to use one of this styles:
http://www.openandromaps.org/en/legend/elevate-mountain-hike-theme
This syntax is unusual in javascript
mapsforge.cache.getTile([x,y,zoom],{ onSuccess: function(result) {
},
onError:function(){
}}
I would expect something like
mapsforge.cache.getTile([x,y,zoom], function(result) {
},function(error){
})
Promise Syntax is also nice:
mapsforge.cache.getTile([x,y,zoom]).then(function(result) {
},function(error){
})
Hi,
I am trying to load a MapView on a Samsung Galaxy Tab (10 inch). When the map loads, it occupies the entire screen. I need it to be placed around 10-20px below my header. Currently, I have an HTML div that is used to load the map.
However, instead of loading the map in the div, it occupies the entire screen.
Is there any way I can reduce the height of the map being rendered?
regards,
Karan
Do you have any news about iOS support? its in development?
thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.