GithubHelp home page GithubHelp logo

afsuarez / mapsforge-cordova-plugin Goto Github PK

View Code? Open in Web Editor NEW
18.0 3.0 8.0 1.51 MB

Plugin for Apache Cordova (aka Phonegap) that wraps the mapsforge libraries. :warning:Discontinued:warning:

Java 89.07% JavaScript 10.93%

mapsforge-cordova-plugin's People

Contributors

afsuarez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mapsforge-cordova-plugin's Issues

Map file not found

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: '&copy; <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 ?

Code review, more docs and examples

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.

Tile cache

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?

Adding plugin via "Visual Studio Tools for Apache Cordova"

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

image

Next changes

  • Include the latest mapsforge version
  • Make possible to use the bounding box mapsforge's functionality
  • Promise syntax for the javascript interface
  • When asking for a tile, return an error if the tile is out of the limits of the map

setThemePath error message

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

callback syntax

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){
})

MapView occupies entire screen

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.